when a hardware frame is made writable, the new frame can get the aligned
hardware buffer dimensions instead of the original frame dimensions

preserve the original width and height for video frames when creating the 
writable frame

this fixes an issue with overlay_cuda producing a 1920x1088 frame from a 
1920x1080 input.

Signed-off-by: arin <[email protected]>
---
 libavfilter/avfilter.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index d10836df3b..68f0581480 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -1587,6 +1587,11 @@ int ff_inlink_make_frame_writable(AVFilterLink *link, 
AVFrame **rframe)
     if (!out)
         return AVERROR(ENOMEM);
 
+    if (link->type == AVMEDIA_TYPE_VIDEO) {
+        out->width = frame->width;
+        out->height = frame->height;
+    }
+
     ret = av_frame_copy_props(out, frame);
     if (ret < 0) {
         av_frame_free(&out);
-- 
2.55.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to