summaryrefslogtreecommitdiff
path: root/libavcodec/pngdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-04-15 17:41:17 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-04-15 18:21:53 +0200
commitc7dc19d68f5de4ee150e601875d43dc80bd6c285 (patch)
tree877b403d78cafe00242ac360ce20cc271495ec4b /libavcodec/pngdec.c
parenta9e7e98021ca9f2eba260c6a6f22a9a476332b24 (diff)
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/pngdec.c')
-rw-r--r--libavcodec/pngdec.c5
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];