diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2018-02-26 16:44:50 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2018-02-27 19:37:06 +0100 |
commit | f9cb17f988cc72048f2051ce120ccbd6d05ce1c2 (patch) | |
tree | 4262276e690d4048e180fe1813e5420449756d90 /libavcodec/msmpeg4dec.c | |
parent | 8b5c29b6c2ab00f8fb545475238a99f575b5d81d (diff) | |
download | ffmpeg-f9cb17f988cc72048f2051ce120ccbd6d05ce1c2.tar.gz |
avcodec/msmpeg4dec: Check for input end in msmpeg4v34_decode_mb()
Fixes: Timeout
Fixes: 6276/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMV1_fuzzer-5881196690014208
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/msmpeg4dec.c')
-rw-r--r-- | libavcodec/msmpeg4dec.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/msmpeg4dec.c b/libavcodec/msmpeg4dec.c index 4105d4ba7d..457a37e745 100644 --- a/libavcodec/msmpeg4dec.c +++ b/libavcodec/msmpeg4dec.c @@ -208,6 +208,9 @@ static int msmpeg4v34_decode_mb(MpegEncContext *s, int16_t block[6][64]) uint8_t *coded_val; uint32_t * const mb_type_ptr = &s->current_picture.mb_type[s->mb_x + s->mb_y*s->mb_stride]; + if (get_bits_left(&s->gb) <= 0) + return AVERROR_INVALIDDATA; + if (s->pict_type == AV_PICTURE_TYPE_P) { if (s->use_skip_mb_code) { if (get_bits1(&s->gb)) { |