From 09ab885975982a9605c26b285f4409bf3383990a Mon Sep 17 00:00:00 2001 From: Vitor Sessak Date: Fri, 5 Mar 2010 20:04:24 +0000 Subject: [PATCH] Round correctly chroma picture height. Fix issue 956. Originally committed as revision 22223 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/imgconvert.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c index e1dde8146d..0fb2fe6c46 100644 --- a/libavcodec/imgconvert.c +++ b/libavcodec/imgconvert.c @@ -760,8 +760,8 @@ int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width, for (i=0; i> 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) { -- GitLab