Mercurial > libavcodec.hg
comparison rv10.c @ 4646:cd5964d440e8 libavcodec
Check dimensions to avoid division by zero due to invalid new dimensions.
Partially fixes http://bugzilla.mplayerhq.hu/show_bug.cgi?id=773.
author | reimar |
---|---|
date | Sun, 11 Mar 2007 09:16:11 +0000 |
parents | 05e932ddaaa9 |
children | d138b2abf3d5 |
comparison
equal
deleted
inserted
replaced
4645:056127e5df89 | 4646:cd5964d440e8 |
---|---|
452 new_w= s->width; //FIXME wrong we of course must save the original in the context | 452 new_w= s->width; //FIXME wrong we of course must save the original in the context |
453 new_h= s->height; | 453 new_h= s->height; |
454 } | 454 } |
455 if(new_w != s->width || new_h != s->height){ | 455 if(new_w != s->width || new_h != s->height){ |
456 av_log(s->avctx, AV_LOG_DEBUG, "attempting to change resolution to %dx%d\n", new_w, new_h); | 456 av_log(s->avctx, AV_LOG_DEBUG, "attempting to change resolution to %dx%d\n", new_w, new_h); |
457 if (avcodec_check_dimensions(s->avctx, new_h, new_w) < 0) | |
458 return -1; | |
457 MPV_common_end(s); | 459 MPV_common_end(s); |
458 s->width = s->avctx->width = new_w; | 460 s->width = s->avctx->width = new_w; |
459 s->height = s->avctx->height= new_h; | 461 s->height = s->avctx->height= new_h; |
460 if (MPV_common_init(s) < 0) | 462 if (MPV_common_init(s) < 0) |
461 return -1; | 463 return -1; |