Commit 287dbb07 authored by Andreas Cadhalpun's avatar Andreas Cadhalpun Committed by Michael Niedermayer

pngdec: check s->last_picture.f->data[0] before using it

This check was removed in commit 08aec6f6, but
s->last_picture.f->data[0] is still used in handle_p_frame_apng
unconditionally.

This fixes a segmentation fault.
Signed-off-by: 's avatarAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 042260cd
......@@ -1070,7 +1070,7 @@ exit_loop:
/* handle p-frames only if a predecessor frame is available */
ref = s->dispose_op == APNG_DISPOSE_OP_PREVIOUS ?
s->previous_picture.f : s->last_picture.f;
if (ref->data[0]) {
if (ref->data[0] && s->last_picture.f->data[0]) {
if ( !(avpkt->flags & AV_PKT_FLAG_KEY) && avctx->codec_tag != AV_RL32("MPNG")
&& ref->width == p->width
&& ref->height== p->height
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment