diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-04-15 17:41:17 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-04-15 18:21:53 +0200 |
commit | c7dc19d68f5de4ee150e601875d43dc80bd6c285 (patch) | |
tree | 877b403d78cafe00242ac360ce20cc271495ec4b /libavcodec | |
parent | a9e7e98021ca9f2eba260c6a6f22a9a476332b24 (diff) | |
download | ffmpeg-c7dc19d68f5de4ee150e601875d43dc80bd6c285.tar.gz |
png: make sure the previous frames dimensions match before using it as reference
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/pngdec.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 967d5567e8..a96d3cd5d4 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -675,7 +675,10 @@ static int decode_frame(AVCodecContext *avctx, /* handle p-frames only if a predecessor frame is available */ if(s->last_picture->data[0] != NULL) { - if(!(avpkt->flags & AV_PKT_FLAG_KEY)) { + if( !(avpkt->flags & AV_PKT_FLAG_KEY) + && s->last_picture->width == s->current_picture->width + && s->last_picture->height== s->current_picture->height + ) { int i, j; uint8_t *pd = s->current_picture->data[0]; uint8_t *pd_last = s->last_picture->data[0]; |