Affects in particular DXVA2/D3D11VA, which asks for 128 pixels
alignment. The AVHWFramesContext will return AVFrames with that larger
size set. We need to crop it back in the decoder.
---
 libavcodec/hevc_refs.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/hevc_refs.c b/libavcodec/hevc_refs.c
index 0c1918793e..d21cd982df 100644
--- a/libavcodec/hevc_refs.c
+++ b/libavcodec/hevc_refs.c
@@ -93,6 +93,9 @@ static HEVCFrame *alloc_frame(HEVCContext *s)
         if (ret < 0)
             return NULL;
 
+        frame->tf.f->width  = FFMIN(frame->tf.f->width,  s->avctx->width);
+        frame->tf.f->height = FFMIN(frame->tf.f->height, s->avctx->height);
+
         frame->rpl_buf = av_buffer_allocz(s->pkt.nb_nals * 
sizeof(RefPicListTab));
         if (!frame->rpl_buf)
             goto fail;
-- 
2.11.0

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to