X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fimgconvert.c;h=68f1a7574614da2bdf3fb06badae794b05ae1e57;hb=9a58234feaae8b387b7a7e41b643ec619534d26a;hp=8f789c4ae0c2243c3670e1504d51c8aa0fc3a9fc;hpb=ba87f0801d77c21eb1e4891ca1f846500bbb0939;p=ffmpeg diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c index 8f789c4ae0c..68f1a757461 100644 --- a/libavcodec/imgconvert.c +++ b/libavcodec/imgconvert.c @@ -32,9 +32,9 @@ #include "avcodec.h" #include "dsputil.h" -#include "colorspace.h" #include "internal.h" #include "imgconvert.h" +#include "libavutil/colorspace.h" #include "libavutil/pixdesc.h" #if HAVE_MMX @@ -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;