diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2010-06-06 22:29:39 +0400 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2010-06-06 22:29:39 +0400 |
commit | 2839c56ea6fe01242ecc2ea666403216dfc175d6 (patch) | |
tree | 675e3ea96e528f7965ef38c4497306a1f0c62e2d /libavcodec/imgconvert.c | |
parent | 48ede394d5efd9f7b24b2787b4d1cf276d719121 (diff) |
Fix width computation for nv12/nv21 in ff_get_plane_bytewidth().
Originally committed as revision 23507 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/imgconvert.c')
-rw-r--r-- | libavcodec/imgconvert.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c index 8f789c4ae0..4984f2cb1b 100644 --- a/libavcodec/imgconvert.c +++ b/libavcodec/imgconvert.c @@ -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; |