History

vp8: fix crash due to skiped update_dimensions().

Michael Niedermayer committed 14 years ago

Commit 4d870011 parent 70d54391 file · +2 −2Browse files

Unified · Split

libavcodec/vp8.c+2−2
@@ -108,7 +108,7 @@ static void vp8_decode_flush(AVCodecContext *avctx) · 107 unmodified lines
108108
109109 static int update_dimensions(VP8Context *s, int width, int height)
110110 {
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 ||
112112 height != s->avctx->height) {
113113 if (av_image_check_size(width, height, 0, s->avctx))
114114 return AVERROR_INVALIDDATA;
@@ -333,7 +333,7 @@ static int decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_size) · 218 unmodified lines
333333 }
334334
335335 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) {
337337 if ((ret = update_dimensions(s, width, height)) < 0)
338338 return ret;
339339 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t