1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-08 13:22:53 +02:00

avcodec/wavpackenc: Use unsigned for potential 31bit shift

Fixes: CID1465481 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 6f976db251)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2024-05-19 04:49:15 +02:00
parent 0e746e97a3
commit 7a73598b3f
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64

View File

@ -1978,7 +1978,7 @@ static void encode_flush(WavPackEncodeContext *s)
put_bits(pb, 31, 0x7FFFFFFF);
cbits -= 31;
} else {
put_bits(pb, cbits, (1 << cbits) - 1);
put_bits(pb, cbits, (1U << cbits) - 1);
cbits = 0;
}
} while (cbits);
@ -2007,7 +2007,7 @@ static void encode_flush(WavPackEncodeContext *s)
put_bits(pb, 31, 0x7FFFFFFF);
cbits -= 31;
} else {
put_bits(pb, cbits, (1 << cbits) - 1);
put_bits(pb, cbits, (1U << cbits) - 1);
cbits = 0;
}
} while (cbits);