[FFmpeg-cvslog] avcodec/fmvc: Check if header fields are available before allocating the image
Michael Niedermayer
git at videolan.org
Thu Jun 27 20:49:10 EEST 2019
ffmpeg | branch: release/4.1 | Michael Niedermayer <michael at niedermayer.cc> | Sun Jun 2 23:16:40 2019 +0200| [a56b96a3dade2552efd13a30d395c135fab7f8cb] | committer: Michael Niedermayer
avcodec/fmvc: Check if header fields are available before allocating the image
Fixes: Timeout (15sec -> 0.5sec)
Fixes: 14846/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FMVC_fuzzer-5068322120400896
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 561cc161ca617c1b8d48fef0f02d56c0f1af0486)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a56b96a3dade2552efd13a30d395c135fab7f8cb
---
libavcodec/fmvc.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libavcodec/fmvc.c b/libavcodec/fmvc.c
index 5778d7b53f..5bee96a18d 100644
--- a/libavcodec/fmvc.c
+++ b/libavcodec/fmvc.c
@@ -402,6 +402,9 @@ static int decode_frame(AVCodecContext *avctx, void *data,
AVFrame *frame = data;
int ret, y, x;
+ if (avpkt->size < 8)
+ return AVERROR_INVALIDDATA;
+
if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
return ret;
More information about the ffmpeg-cvslog
mailing list