Message ID | 20190615220056.21784-1-michael@niedermayer.cc |
---|---|
State | Accepted |
Commit | 930cdef80ab695132d3de2128c3c23f2d698918b |
Headers | show |
On Sun, Jun 16, 2019 at 12:00:52AM +0200, Michael Niedermayer wrote: > 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 <michael@niedermayer.cc> > --- > libavcodec/motionpixels.c | 2 ++ > 1 file changed, 2 insertions(+) will apply [...]
diff --git a/libavcodec/motionpixels.c b/libavcodec/motionpixels.c index a88b837b3e..73977664a5 100644 --- a/libavcodec/motionpixels.c +++ b/libavcodec/motionpixels.c @@ -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; }
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 <michael@niedermayer.cc> --- libavcodec/motionpixels.c | 2 ++ 1 file changed, 2 insertions(+)