summaryrefslogtreecommitdiff
path: root/libavcodec/pngdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-06-29 21:57:12 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-06-29 21:57:12 +0200
commita1736926e9ae51706b537776722e816a4d1f6b36 (patch)
tree7776a0fff03da9bb12bb33c48c4af522f82203be /libavcodec/pngdec.c
parent47f4e2d8960ca756ca153ab8e3e93d80449b8c91 (diff)
avcodec/pngdec: Require a IHDR chunk before fctl
This is required by the APNG spec Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/pngdec.c')
-rw-r--r--libavcodec/pngdec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index f8b398ffde..85bc447a81 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -824,6 +824,11 @@ static int decode_fctl_chunk(AVCodecContext *avctx, PNGDecContext *s,
if (length != 26)
return AVERROR_INVALIDDATA;
+ if (!(s->state & PNG_IHDR)) {
+ av_log(avctx, AV_LOG_ERROR, "fctl before IHDR\n");
+ return AVERROR_INVALIDDATA;
+ }
+
s->last_w = s->cur_w;
s->last_h = s->cur_h;
s->last_x_offset = s->x_offset;