avcodec/webp: Fixes null pointer dereference
authorMichael Niedermayer <michael@niedermayer.cc>
Wed, 10 May 2017 16:37:50 +0000 (18:37 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Sun, 28 May 2017 19:20:09 +0000 (21:20 +0200)
Fixes: 1470/clusterfuzz-testcase-minimized-5404421666111488
Fixes: 1472/clusterfuzz-testcase-minimized-5677426430443520
Fixes: 1875/clusterfuzz-testcase-minimized-5536474562822144

Approved-by: BBB
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/webp.c

index 50a8da1..a0d4d18 100644 (file)
@@ -1351,6 +1351,9 @@ static int vp8_lossy_decode_frame(AVCodecContext *avctx, AVFrame *p,
     if (ret < 0)
         return ret;
 
+    if (!*got_frame)
+        return AVERROR_INVALIDDATA;
+
     update_canvas_size(avctx, avctx->width, avctx->height);
 
     if (s->has_alpha) {