[FFmpeg-devel] avcodec/fmvc: Check if header fields are available before allocating the image

Submitted by Michael Niedermayer on June 2, 2019, 9:16 p.m.

Details

Message ID 20190602211640.28143-1-michael@niedermayer.cc
State Accepted
Commit 561cc161ca617c1b8d48fef0f02d56c0f1af0486
Headers show

Commit Message

Michael Niedermayer June 2, 2019, 9:16 p.m.
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
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/fmvc.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Paul B Mahol June 3, 2019, 8:55 a.m.
On 6/2/19, Michael Niedermayer <michael@niedermayer.cc> wrote:
> 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
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>

OK
Michael Niedermayer June 21, 2019, 2:43 p.m.
On Mon, Jun 03, 2019 at 10:55:20AM +0200, Paul B Mahol wrote:
> On 6/2/19, Michael Niedermayer <michael@niedermayer.cc> wrote:
> > 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
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> 
> OK

will apply

thx

[...]

Patch hide | download patch | download mbox

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;