diff --git a/libavcodec/utils.c b/libavcodec/utils.c index bed664e7e8..94e8b579d4 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -762,8 +762,8 @@ do { \ planes = (desc->flags & PIX_FMT_PLANAR) ? desc->nb_components : 1; for (i = 0; i < planes; i++) { - int h_shift = (i == 1 || i == 2) ? desc->log2_chroma_h : 0; - int plane_size = (frame->width >> h_shift) * frame->linesize[i]; + int v_shift = (i == 1 || i == 2) ? desc->log2_chroma_h : 0; + int plane_size = (frame->height >> v_shift) * frame->linesize[i]; WRAP_PLANE(frame->buf[i], frame->data[i], plane_size); } diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c index 54a58fe1e9..70da5296d9 100644 --- a/libavfilter/buffersrc.c +++ b/libavfilter/buffersrc.c @@ -232,8 +232,8 @@ do { \ planes = (desc->flags & PIX_FMT_PLANAR) ? desc->nb_components : 1; for (i = 0; i < planes; i++) { - int h_shift = (i == 1 || i == 2) ? desc->log2_chroma_h : 0; - int plane_size = (frame->width >> h_shift) * frame->linesize[i]; + int v_shift = (i == 1 || i == 2) ? desc->log2_chroma_w : 0; + int plane_size = (frame->height >> v_shift) * frame->linesize[i]; WRAP_PLANE(frame->buf[i], frame->data[i], plane_size); }