diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-06-29 21:57:12 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-07-20 04:43:40 +0200 |
commit | 873b08f4111af41d2456662db86075a450d3ca81 (patch) | |
tree | a5037122d70908b847dd09ff7e949ef614e80fe3 | |
parent | 63ef4014c5ff13953025af861976f79c85cf373f (diff) | |
download | ffmpeg-873b08f4111af41d2456662db86075a450d3ca81.tar.gz |
avcodec/pngdec: Require a IHDR chunk before fctl
This is required by the APNG spec
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a1736926e9ae51706b537776722e816a4d1f6b36)
Conflicts:
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 5a2c9c2960..4a541d49a2 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -814,6 +814,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; + } + sequence_number = bytestream2_get_be32(&s->gb); s->cur_w = bytestream2_get_be32(&s->gb); s->cur_h = bytestream2_get_be32(&s->gb); |