]> git.sesse.net Git - ffmpeg/commitdiff
Fix width computation for nv12/nv21 in ff_get_plane_bytewidth().
authorStefano Sabatini <stefano.sabatini-lala@poste.it>
Sun, 6 Jun 2010 18:29:39 +0000 (18:29 +0000)
committerStefano Sabatini <stefano.sabatini-lala@poste.it>
Sun, 6 Jun 2010 18:29:39 +0000 (18:29 +0000)
Originally committed as revision 23507 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/imgconvert.c

index 8f789c4ae0c2243c3670e1504d51c8aa0fc3a9fc..4984f2cb1bb8f50925ce65873759dd59a3b114c1 100644 (file)
@@ -948,7 +948,8 @@ int ff_get_plane_bytewidth(enum PixelFormat pix_fmt, int width, int plane)
         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;