Unified · Split
| @@ -108,7 +108,7 @@ static void vp8_decode_flush(AVCodecContext *avctx) · 107 unmodified lines | |||
| 108 | 108 | ||
| 109 | static int update_dimensions(VP8Context *s, int width, int height) | 109 | static int update_dimensions(VP8Context *s, int width, int height) |
| 110 | { | 110 | { |
| 111 | if (width != s->avctx->width || | 111 | if (width != s->avctx->width || ((width+15)/16 != s->mb_width || (height+15)/16 != s->mb_height) && s->macroblocks_base || |
| 112 | height != s->avctx->height) { | 112 | height != s->avctx->height) { |
| 113 | if (av_image_check_size(width, height, 0, s->avctx)) | 113 | if (av_image_check_size(width, height, 0, s->avctx)) |
| 114 | return AVERROR_INVALIDDATA; | 114 | return AVERROR_INVALIDDATA; |
| @@ -333,7 +333,7 @@ static int decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_size) · 218 unmodified lines | |||
| 333 | } | 333 | } |
| 334 | 334 | ||
| 335 | if (!s->macroblocks_base || /* first frame */ | 335 | if (!s->macroblocks_base || /* first frame */ |
| 336 | width != s->avctx->width || height != s->avctx->height) { | 336 | width != s->avctx->width || height != s->avctx->height || (width+15)/16 != s->mb_width || (height+15)/16 != s->mb_height) { |
| 337 | if ((ret = update_dimensions(s, width, height)) < 0) | 337 | if ((ret = update_dimensions(s, width, height)) < 0) |
| 338 | return ret; | 338 | return ret; |
| 339 | } | 339 | } |