[FFmpeg-cvslog] avcodec/pngdec: Require a IHDR chunk before fctl

Michael Niedermayer git at videolan.org
Mon Jul 20 10:48:24 CEST 2015


ffmpeg | branch: release/2.6 | Michael Niedermayer <michaelni at gmx.at> | Mon Jun 29 21:57:12 2015 +0200| [873b08f4111af41d2456662db86075a450d3ca81] | committer: Michael Niedermayer

avcodec/pngdec: Require a IHDR chunk before fctl

This is required by the APNG spec

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit a1736926e9ae51706b537776722e816a4d1f6b36)

Conflicts:

	libavcodec/pngdec.c

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=873b08f4111af41d2456662db86075a450d3ca81
---

 libavcodec/pngdec.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index 5a2c9c2..4a541d4 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);



More information about the ffmpeg-cvslog mailing list