diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-06-29 22:57:12 +0300 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-06-29 22:57:12 +0300 |
commit | a1736926e9ae51706b537776722e816a4d1f6b36 (patch) | |
tree | 7776a0fff03da9bb12bb33c48c4af522f82203be /libavcodec/pngdec.c | |
parent | 47f4e2d8960ca756ca153ab8e3e93d80449b8c91 (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.c | 5 |
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; |