ffmpeg | branch: release/2.7 | Michael Niedermayer <michae...@gmx.at> | Mon Jun 
29 21:57:12 2015 +0200| [be54d1f1043e9e4fc58bb7889c9cf85b52de5396] | committer: 
Michael Niedermayer

avcodec/pngdec: Require a IHDR chunk before fctl

This is required by the APNG spec

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

Signed-off-by: Michael Niedermayer <michae...@gmx.at>

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

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

diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index f8b398f..85bc447 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;

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

Reply via email to