mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-08 07:38:30 +00: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 a1736926e9
)
Conflicts:
libavcodec/pngdec.c
This commit is contained in:
parent
d661cfad02
commit
0628dfd994
@ -813,6 +813,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);
|
||||
|
Loading…
Reference in New Issue
Block a user