summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavcodec/imgconvert.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c
index 4698fcf82e..9826a6a358 100644
--- a/libavcodec/imgconvert.c
+++ b/libavcodec/imgconvert.c
@@ -897,7 +897,7 @@ int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width,
for (i=0; i<data_planes; i++) {
if (i == 1) {
- w = width >> pf->x_chroma_shift;
+ w = ((width >> pf->x_chroma_shift) * pf->depth + 7) / 8;
h = height >> pf->y_chroma_shift;
} else if (i == 3) {
w = ow;