mirror of https://git.ffmpeg.org/ffmpeg.git
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:
parent
027e1b567f
commit
96a7029503
|
@ -230,8 +230,8 @@ static int read_high_coeffs(AVCodecContext *avctx, uint8_t *src, int16_t *dst,
|
|||
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);
|
||||
|
|
Loading…
Reference in New Issue