summaryrefslogtreecommitdiff
path: root/libavcodec/hevc_refs.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2022-03-08 10:55:00 -0300
committerJames Almer <jamrial@gmail.com>2022-03-15 18:16:54 -0300
commit3aeeee1597abd6c12308fbc2f4087d7c943166df (patch)
tree888e4bbf3cc7312769a78b807d4582a9eba09121 /libavcodec/hevc_refs.c
parentf5d67469b0e15402a6323e2e657572db8d17f8fe (diff)
downloadffmpeg-3aeeee1597abd6c12308fbc2f4087d7c943166df.tar.gz
avcodec/hevc_refs: don't use the frame's AVBufferRef sizes when initializing planes
Use the actual plane sizes instead. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/hevc_refs.c')
-rw-r--r--libavcodec/hevc_refs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/hevc_refs.c b/libavcodec/hevc_refs.c
index 35b8e5e696..fe18ca2b1d 100644
--- a/libavcodec/hevc_refs.c
+++ b/libavcodec/hevc_refs.c
@@ -401,9 +401,9 @@ static HEVCFrame *generate_missing_ref(HEVCContext *s, int poc)
if (!s->avctx->hwaccel) {
if (!s->ps.sps->pixel_shift) {
- for (i = 0; frame->frame->buf[i]; i++)
- memset(frame->frame->buf[i]->data, 1 << (s->ps.sps->bit_depth - 1),
- frame->frame->buf[i]->size);
+ for (i = 0; frame->frame->data[i]; i++)
+ memset(frame->frame->data[i], 1 << (s->ps.sps->bit_depth - 1),
+ frame->frame->linesize[i] * AV_CEIL_RSHIFT(s->ps.sps->height, s->ps.sps->vshift[i]));
} else {
for (i = 0; frame->frame->data[i]; i++)
for (y = 0; y < (s->ps.sps->height >> s->ps.sps->vshift[i]); y++) {