[FFmpeg-cvslog] avcodec/cbs_av1: Avoid shift overflow

Michael Niedermayer git at videolan.org
Thu Jun 13 23:40:46 EEST 2024


ffmpeg | branch: release/5.1 | Michael Niedermayer <michael at niedermayer.cc> | Wed May  1 21:44:33 2024 +0200| [ed6b5d616439f4ca2c7075c05b514d0fa00cad85] | committer: Michael Niedermayer

avcodec/cbs_av1: Avoid shift overflow

Fixes: CID1465488 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit d7924a4f60f2088de1e6790345caba929eb97030)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ed6b5d616439f4ca2c7075c05b514d0fa00cad85
---

 libavcodec/cbs_av1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/cbs_av1.c b/libavcodec/cbs_av1.c
index 1229480567..6913bc6781 100644
--- a/libavcodec/cbs_av1.c
+++ b/libavcodec/cbs_av1.c
@@ -379,7 +379,7 @@ static int cbs_av1_write_increment(CodedBitstreamContext *ctx, PutBitContext *pb
     }
 
     if (len > 0)
-        put_bits(pbc, len, (1 << len) - 1 - (value != range_max));
+        put_bits(pbc, len, (1U << len) - 1 - (value != range_max));
 
     return 0;
 }



More information about the ffmpeg-cvslog mailing list