changeset 36143:3c1595fcf004

Update calculation of allocation size for direct rendering.
author reimar
date Sun, 05 May 2013 07:27:33 +0000
parents 1cfb48d5243f
children 43bff9dd44be
files libmpcodecs/vd_ffmpeg.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vd_ffmpeg.c	Sun May 05 07:27:32 2013 +0000
+++ b/libmpcodecs/vd_ffmpeg.c	Sun May 05 07:27:33 2013 +0000
@@ -552,8 +552,8 @@
     mp_image_t *mpi=NULL;
     int flags= MP_IMGFLAG_ACCEPT_ALIGNED_STRIDE | MP_IMGFLAG_PREFER_ALIGNED_STRIDE;
     int type= MP_IMGTYPE_IPB;
-    int width= avctx->width;
-    int height= avctx->height;
+    int width = FFMAX(avctx->width,  -(-avctx->coded_width  >> avctx->lowres));
+    int height= FFMAX(avctx->height, -(-avctx->coded_height >> avctx->lowres));
     // special case to handle reget_buffer
     if (pic->opaque && pic->data[0] && (!pic->buffer_hints || pic->buffer_hints & FF_BUFFER_HINTS_REUSABLE))
         return 0;