]> git.sesse.net Git - ffmpeg/commitdiff
avcodec: Fix lowres handling in buffer allocation
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 19 Apr 2013 19:43:15 +0000 (21:43 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 19 Apr 2013 19:49:36 +0000 (21:49 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/utils.c

index 0ea1b53a8b30e3cc243a700b68d83089517bc0a0..1733d0f1a3248a60b110060ed6f412b164ff271b 100644 (file)
@@ -621,8 +621,8 @@ int ff_init_buffer_info(AVCodecContext *avctx, AVFrame *frame)
 
     switch (avctx->codec->type) {
     case AVMEDIA_TYPE_VIDEO:
-        frame->width  = FFMAX(avctx->width, avctx->coded_width);
-        frame->height = FFMAX(avctx->height, avctx->coded_height);
+        frame->width  = FFMAX(avctx->width , -((-avctx->coded_width )>>avctx->lowres));
+        frame->height = FFMAX(avctx->height, -((-avctx->coded_height)>>avctx->lowres));
         if (frame->format < 0)
             frame->format              = avctx->pix_fmt;
         if (!frame->sample_aspect_ratio.num)