diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2024-04-26 23:22:53 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2024-04-27 21:16:40 +0200 |
commit | 091fdce87e88c8622d8af89ffa6cbb0dc20c3816 (patch) | |
tree | 3496665fe19ecafbe346a15bf59a8a1c6cf09515 | |
parent | d9699464c3b2b2b02f21d60ead49c8eb829052fb (diff) | |
download | ffmpeg-091fdce87e88c8622d8af89ffa6cbb0dc20c3816.tar.gz |
avcodec/pngdec: Check last AVFrame before deref
Fixes: NULL pointer dereference
Fixes: 68184/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APNG_fuzzer-4926478069334016
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
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 f7751223b8..8934a95a7f 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -1218,7 +1218,7 @@ static int decode_fctl_chunk(AVCodecContext *avctx, PNGDecContext *s, return AVERROR_INVALIDDATA; } - if ((sequence_number == 0 || !s->last_picture.f->data[0]) && + if ((sequence_number == 0 || !s->last_picture.f) && dispose_op == APNG_DISPOSE_OP_PREVIOUS) { // No previous frame to revert to for the first frame // Spec says to just treat it as a APNG_DISPOSE_OP_BACKGROUND |