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
231231 if (cnt1 >= length) {
232232 cnt1 = get_bits(bc, nbits);
233233 } else {
234− pfx = 14 + ((((uint64_t)(value - 14)) >> 32) & (value - 14));
235− if (pfx < 1 || pfx > 25)
234+ pfx = FFMIN(value, 14);
235+ if (pfx < 1)
236236 return AVERROR_INVALIDDATA;
237237 cnt1 *= (1 << pfx) - 1;
238238 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