changeset 11842:3c812305443b libavcodec

Fix width computation for nv12/nv21 in ff_get_plane_bytewidth().
author stefano
date Sun, 06 Jun 2010 18:29:39 +0000
parents 37c2c2afd349
children c2438ba304e0
files imgconvert.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/imgconvert.c	Sun Jun 06 15:27:37 2010 +0000
+++ b/imgconvert.c	Sun Jun 06 18:29:39 2010 +0000
@@ -948,7 +948,8 @@
         return (width * bits + 7) >> 3;
         break;
     case FF_PIXEL_PLANAR:
-            if (plane == 1 || plane == 2)
+            if ((pix_fmt != PIX_FMT_NV12 && pix_fmt != PIX_FMT_NV21) &&
+                (plane == 1 || plane == 2))
                 width= -((-width)>>desc->log2_chroma_w);
 
             return (width * pf->depth + 7) >> 3;