[FFmpeg-cvslog] avcodec: Fix lowres handling in buffer allocation

Michael Niedermayer git at videolan.org
Fri Apr 19 21:53:16 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Apr 19 21:43:15 2013 +0200| [05b2c998c7bfea642e3541787ab5dd3847e2ba81] | committer: Michael Niedermayer

avcodec: Fix lowres handling in buffer allocation

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=05b2c998c7bfea642e3541787ab5dd3847e2ba81
---

 libavcodec/utils.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 0ea1b53..1733d0f 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -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)



More information about the ffmpeg-cvslog mailing list