diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-04-07 19:29:44 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-07-03 12:10:24 +0200 |
commit | d303f28c57f98992e8f1c056057ab49f933c4c86 (patch) | |
tree | e68079c037790667acc369372a0e022c04380a91 | |
parent | 9e8e8a630e96389b118e7241adb597cbf013e3bb (diff) | |
download | ffmpeg-d303f28c57f98992e8f1c056057ab49f933c4c86.tar.gz |
avcodec/pngdec: Check length in fdAT
Fixes: 21089/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APNG_fuzzer-5135981419429888
Fixes: out of array read
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 79e5c2ee2bbdf462cabd2113c723dfb613d735c2)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/pngdec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index cd7cd46798..1be0e245cb 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -1242,7 +1242,7 @@ static int decode_frame_common(AVCodecContext *avctx, PNGDecContext *s, case MKTAG('f', 'd', 'A', 'T'): if (!CONFIG_APNG_DECODER || avctx->codec_id != AV_CODEC_ID_APNG) goto skip_tag; - if (!decode_next_dat) { + if (!decode_next_dat || length < 4) { ret = AVERROR_INVALIDDATA; goto fail; } |