mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-02-04 06:08:26 +02:00
avcodec/shorten: Check k in get_uint()
Fixes: undefined shift Fixes: 1371/clusterfuzz-testcase-minimized-5770822591447040 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 7b6a51f59c467ab9f4b73122dc269206fb517425) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
28c618355c
commit
2ff5e3f54e
@ -160,8 +160,11 @@ static int allocate_buffers(ShortenContext *s)
|
||||
|
||||
static inline unsigned int get_uint(ShortenContext *s, int k)
|
||||
{
|
||||
if (s->version != 0)
|
||||
if (s->version != 0) {
|
||||
k = get_ur_golomb_shorten(&s->gb, ULONGSIZE);
|
||||
if (k > 31U)
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
return get_ur_golomb_shorten(&s->gb, k);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user