Browse Source

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 7b6a51f59c)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n3.1.8
Michael Niedermayer 8 years ago
parent
commit
22de9c949a
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      libavcodec/shorten.c

+ 4
- 1
libavcodec/shorten.c View File

@@ -155,8 +155,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…
Cancel
Save