diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-07-10 23:02:36 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-11-11 20:18:46 +0100 |
commit | 183602db8953a221ba881911754df9eb9db6635d (patch) | |
tree | 7774cb037dce6f060f6655fd584fe473e0baf61c /libavcodec/pngdec.c | |
parent | 2ace949ee64080b6651fe246c4d13b614e54c7fb (diff) | |
download | ffmpeg-183602db8953a221ba881911754df9eb9db6635d.tar.gz |
avcodec/pngdec: Check that previous_picture has same w/h/format
Fixes: out of array access
Fixes: 15540/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APNG_fuzzer-5684905029140480
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 18c808ffbed81ea580fe6ddd6524dd7bea3f8d0e)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/pngdec.c')
-rw-r--r-- | libavcodec/pngdec.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index f761f2f7d9..eead165721 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -1391,6 +1391,9 @@ exit_loop: if (CONFIG_PNG_DECODER && avctx->codec_id != AV_CODEC_ID_APNG) handle_p_frame_png(s, p); else if (CONFIG_APNG_DECODER && + s->previous_picture.f->width == p->width && + s->previous_picture.f->height== p->height && + s->previous_picture.f->format== p->format && avctx->codec_id == AV_CODEC_ID_APNG && (ret = handle_p_frame_apng(avctx, s, p)) < 0) goto fail; |