History

avcodec/pixlet: Simplify pfx computation

Found by reviewing code related to CID1604365 Overflowed constant

Michael Niedermayer committed 2 years ago

Commit 04746141 parent f18b4421 file · +2 −2Browse files

Unified · Split

libavcodec/pixlet.c+2−2
@@ -231,8 +231,8 @@ static int read_high_coeffs(AVCodecContext *avctx, const uint8_t *src, int16_t * · 230 unmodified lines
231 if (cnt1 >= length) {231 if (cnt1 >= length) {
232 cnt1 = get_bits(bc, nbits);232 cnt1 = get_bits(bc, nbits);
233 } else {233 } else {
234 pfx = 14 + ((((uint64_t)(value - 14)) >> 32) & (value - 14));234 pfx = FFMIN(value, 14);
235 if (pfx < 1 || pfx > 25)235 if (pfx < 1)
236 return AVERROR_INVALIDDATA;236 return AVERROR_INVALIDDATA;
237 cnt1 *= (1 << pfx) - 1;237 cnt1 *= (1 << pfx) - 1;
238 shbits = show_bits(bc, pfx);238 shbits = show_bits(bc, pfx);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t