History

avcodec/pngdec: Check last AVFrame before deref

Fixes: NULL pointer dereference Fixes: 68184/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APNG_fuzzer-4926478069334016

Michael Niedermayer committed 2 years ago

Commit 091fdce1 parent d9699461 file · +1 −1Browse files

Unified · Split

libavcodec/pngdec.c+1−1
@@ -1218,7 +1218,7 @@ static int decode_fctl_chunk(AVCodecContext *avctx, PNGDecContext *s, · 1217 unmodified lines
12181218 return AVERROR_INVALIDDATA;
12191219 }
12201220
1221− if ((sequence_number == 0 || !s->last_picture.f->data[0]) &&
1221+ if ((sequence_number == 0 || !s->last_picture.f) &&
12221222 dispose_op == APNG_DISPOSE_OP_PREVIOUS) {
12231223 // No previous frame to revert to for the first frame
12241224 // Spec says to just treat it as a APNG_DISPOSE_OP_BACKGROUND

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t