1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-02-04 06:08:26 +02:00

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
This commit is contained in:
Michael Niedermayer 2015-06-29 21:57:12 +02:00 committed by Michael Niedermayer
parent 63ef4014c5
commit 873b08f411

View File

@ -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);