diff mbox

[FFmpeg-devel,3/3] avcodec/pictordec: Error out if more than one plane is unused

Message ID 20180912010808.31637-3-michael@niedermayer.cc
State Accepted
Commit 470700bc96c3817667653d87e81b06a3d9b832eb
Headers show

Commit Message

Michael Niedermayer Sept. 12, 2018, 1:08 a.m. UTC
Fixes: Timeout
Fixes: 9797/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PICTOR_fuzzer-5664441659031552

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/pictordec.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Michael Niedermayer Nov. 4, 2018, 11:53 a.m. UTC | #1
On Wed, Sep 12, 2018 at 03:08:08AM +0200, Michael Niedermayer wrote:
> Fixes: Timeout
> Fixes: 9797/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PICTOR_fuzzer-5664441659031552
> 
> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/pictordec.c | 3 +++
>  1 file changed, 3 insertions(+)

will apply

[...]
diff mbox

Patch

diff --git a/libavcodec/pictordec.c b/libavcodec/pictordec.c
index b29a484534..65d2d49060 100644
--- a/libavcodec/pictordec.c
+++ b/libavcodec/pictordec.c
@@ -236,6 +236,9 @@  static int decode_frame(AVCodecContext *avctx,
             }
         }
 
+        if (s->nb_planes - plane > 1)
+            return AVERROR_INVALIDDATA;
+
         if (plane < s->nb_planes && x < avctx->width) {
             int run = (y + 1) * avctx->width - x;
             if (bits_per_plane == 8)