History

avcodec/golomb: Assert that k is in the supported range for get_ur/sr_golomb()

Found by code review related to CID1604563 Overflowed return value

Michael Niedermayer committed 2 years ago

Commit b2aaeb81 parent 7cf5b831 file · +1 −0Browse files

Unified · Split

libavcodec/golomb.h+1−0
@@ -402,6 +402,7 @@ static inline int get_ur_golomb(GetBitContext *gb, int k, int limit, · 401 unmodified lines
402402 log = av_log2(buf);
403403
404404 if (log > 31 - limit) {
405+ av_assert2(log >= k);
405406 buf >>= log - k;
406407 buf += (30U - log) << k;
407408 LAST_SKIP_BITS(re, gb, 32 + k - log);

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