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
108 108
109static int update_dimensions(VP8Context *s, int width, int height)109static 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 }

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