summaryrefslogtreecommitdiff
path: root/libavcodec/pngdec.c
diff options
context:
space:
mode:
authorAndreas Cadhalpun <andreas.cadhalpun@googlemail.com>2015-05-03 16:21:39 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-05-03 17:24:28 +0200
commit287dbb0771d558b336e377d0594e26c0a6291755 (patch)
treee916b76597c8af506a549112379aa27a07f54cc9 /libavcodec/pngdec.c
parent042260cde4ecf716438c5fc92d15ad5f037ee2e1 (diff)
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: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/pngdec.c')
-rw-r--r--libavcodec/pngdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index 3b28b296c9..26de09d6ab 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -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