1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avformat/apngdec: validate frame dimensions.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Benoit Fouet 2014-11-26 10:12:18 +01:00 committed by Michael Niedermayer
parent 345cfd04d0
commit e2b8b4caf6

View File

@ -301,7 +301,11 @@ static int decode_fctl_chunk(AVFormatContext *s, APNGDemuxContext *ctx, AVPacket
height != s->streams[0]->codec->height ||
x_offset != 0 ||
y_offset != 0) {
if (sequence_number == 0)
if (sequence_number == 0 ||
x_offset >= s->streams[0]->codec->width ||
width > s->streams[0]->codec->width - x_offset ||
y_offset >= s->streams[0]->codec->height ||
height > s->streams[0]->codec->height - y_offset)
return AVERROR_INVALIDDATA;
ctx->is_key_frame = 0;
} else {