summaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/cfhd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/cfhd.c b/libavcodec/cfhd.c
index e35732d..f10742f 100644
--- a/libavcodec/cfhd.c
+++ b/libavcodec/cfhd.c
@@ -213,13 +213,14 @@ static int alloc_buffers(AVCodecContext *avctx)
int width = i ? avctx->width >> chroma_x_shift : avctx->width;
int height = i ? avctx->height >> chroma_y_shift : avctx->height;
ptrdiff_t stride = FFALIGN(width / 8, 8) * 8;
- height = FFALIGN(height / 8, 2) * 8;
+ if (chroma_y_shift)
+ height = FFALIGN(height / 8, 2) * 8;
s->plane[i].width = width;
s->plane[i].height = height;
s->plane[i].stride = stride;
w8 = FFALIGN(s->plane[i].width / 8, 8);
- h8 = FFALIGN(s->plane[i].height / 8, 2);
+ h8 = height / 8;
w4 = w8 * 2;
h4 = h8 * 2;
w2 = w4 * 2;
OpenPOWER on IntegriCloud