pngdec: check s->last_picture.f->data[0] before using it
This check was removed in commit08aec6f6
, but s->last_picture.f->data[0] is still used in handle_p_frame_apng unconditionally. This fixes a segmentation fault. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit287dbb0771
) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:

committed by
Michael Niedermayer

parent
4d6d159069
commit
c3653e2265
@@ -1065,7 +1065,7 @@ exit_loop:
|
|||||||
/* handle p-frames only if a predecessor frame is available */
|
/* handle p-frames only if a predecessor frame is available */
|
||||||
ref = s->dispose_op == APNG_DISPOSE_OP_PREVIOUS ?
|
ref = s->dispose_op == APNG_DISPOSE_OP_PREVIOUS ?
|
||||||
s->previous_picture.f : s->last_picture.f;
|
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")
|
if ( !(avpkt->flags & AV_PKT_FLAG_KEY) && avctx->codec_tag != AV_RL32("MPNG")
|
||||||
&& ref->width == p->width
|
&& ref->width == p->width
|
||||||
&& ref->height== p->height
|
&& ref->height== p->height
|
||||||
|
Reference in New Issue
Block a user