Re: [FFmpeg-devel] [PATCH 9/9] avcodec/wavpackenc: Use unsigned for potential 31bit shift
On Sun, May 19, 2024 at 04:49:15AM +0200, Michael Niedermayer wrote: > Fixes: CID1465481 Unintentional integer overflow > > Sponsored-by: Sovereign Tech Fund > Signed-off-by: Michael Niedermayer > --- > libavcodec/wavpackenc.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) will apply the 2 wavpack* patches [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB If the United States is serious about tackling the national security threats related to an insecure 5G network, it needs to rethink the extent to which it values corporate profits and government espionage over security.-Bruce Schneier signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 9/9] avcodec/wavpackenc: Use unsigned for potential 31bit shift
Fixes: CID1465481 Unintentional integer overflow Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavcodec/wavpackenc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/wavpackenc.c b/libavcodec/wavpackenc.c index ba0371592d9..e99ab951d41 100644 --- a/libavcodec/wavpackenc.c +++ b/libavcodec/wavpackenc.c @@ -1979,7 +1979,7 @@ static void encode_flush(WavPackEncodeContext *s) put_bits(pb, 31, 0x7FFF); cbits -= 31; } else { -put_bits(pb, cbits, (1 << cbits) - 1); +put_bits(pb, cbits, (1U << cbits) - 1); cbits = 0; } } while (cbits); @@ -2008,7 +2008,7 @@ static void encode_flush(WavPackEncodeContext *s) put_bits(pb, 31, 0x7FFF); cbits -= 31; } else { -put_bits(pb, cbits, (1 << cbits) - 1); +put_bits(pb, cbits, (1U << cbits) - 1); cbits = 0; } } while (cbits); -- 2.45.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".