mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-02-13 19:05:37 +00:00
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.
This commit is contained in:
parent
23f4c5acc4
commit
6552808014
2 changed files with 4 additions and 4 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -193,8 +193,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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue