diff options
author | Anton Khirnov <anton@khirnov.net> | 2013-03-16 18:09:17 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2013-03-17 09:10:04 +0100 |
commit | 6552808014ae318c8feaa8effac6ee40ea6019ce (patch) | |
tree | e2604a46ae067c7399b94c8d5eb707e59ea381c9 /libavcodec/utils.c | |
parent | 23f4c5acc438366d84cacf49e33b0bcd72f04937 (diff) | |
download | ffmpeg-6552808014ae318c8feaa8effac6ee40ea6019ce.tar.gz |
lavc,lavfi: fix calculating the plane size in the AVBufferRef wrappers
It is supposed to be height * linesize, not width * linesize.
Thanks to Hendrik Leppkes for pointing out the bug.
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r-- | libavcodec/utils.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 818dc5773e..4d57865629 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -667,8 +667,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); } |