diff imgconvert.c @ 11367:fec27e2a7570 libavcodec

Round correctly chroma picture height. Fix issue 956.
author vitor
date Fri, 05 Mar 2010 20:04:24 +0000
parents 3f231ba93f80
children 0124d6beb415
line wrap: on
line diff
--- a/imgconvert.c	Fri Mar 05 08:26:23 2010 +0000
+++ b/imgconvert.c	Fri Mar 05 20:04:24 2010 +0000
@@ -760,8 +760,8 @@
 
     for (i=0; i<data_planes; i++) {
         if (i == 1) {
-            w = ((width >> desc->log2_chroma_w) * pf->depth + 7) / 8;
-            h = height >> desc->log2_chroma_h;
+            w = (- ((-width) >> desc->log2_chroma_w) * pf->depth + 7) / 8;
+            h = -((-height) >> desc->log2_chroma_h);
             if (pix_fmt == PIX_FMT_NV12 || pix_fmt == PIX_FMT_NV21)
                 w <<= 1;
         } else if (i == 3) {