1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec/pixlet: Simplify pfx computation

Found by reviewing code related to CID1604365 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 0474614e6c)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2024-07-05 02:21:56 +02:00
parent d16caed6b1
commit e607479d3c
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64

View File

@ -232,8 +232,8 @@ static int read_high_coeffs(AVCodecContext *avctx, const uint8_t *src, int16_t *
if (cnt1 >= length) {
cnt1 = get_bits(bc, nbits);
} else {
pfx = 14 + ((((uint64_t)(value - 14)) >> 32) & (value - 14));
if (pfx < 1 || pfx > 25)
pfx = FFMIN(value, 14);
if (pfx < 1)
return AVERROR_INVALIDDATA;
cnt1 *= (1 << pfx) - 1;
shbits = show_bits(bc, pfx);