Skip to content

Commit

Permalink
avcodec/motionpixels: Check for vlc error in mp_get_vlc()
Browse files Browse the repository at this point in the history
Fixes: 15246/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MOTIONPIXELS_fuzzer-5168534407086080
Fixes: runtime error: index -1 out of bounds for type 'HuffCode [16]'

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <[email protected]>
  • Loading branch information
michaelni committed Jun 25, 2019
1 parent ce3b0b9 commit 930cdef
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libavcodec/motionpixels.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ static int mp_get_vlc(MotionPixelsContext *mp, GetBitContext *gb)
int i;

i = (mp->codes_count == 1) ? 0 : get_vlc2(gb, mp->vlc.table, mp->max_codes_bits, 1);
if (i < 0)
return i;
return mp->codes[i].delta;
}

Expand Down

0 comments on commit 930cdef

Please sign in to comment.