This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit 1e071c8585467539d48cb33f239811309eed46a0
Author:     Niklas Haas <[email protected]>
AuthorDate: Tue Feb 10 14:58:28 2026 +0100
Commit:     Niklas Haas <[email protected]>
CommitDate: Mon Feb 23 19:39:17 2026 +0000

    swscale/graph: omit memcpy() if src and dst are identical
    
    This allows already referenced planes to be skipped, in the case of e.g.
    only some of the output planes being sucessfully referenced. Also avoids
    what is technically UB, if the user happens to call ff_sws_graph_run() after
    already having ref'd an image.
    
    Signed-off-by: Niklas Haas <[email protected]>
---
 libswscale/graph.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libswscale/graph.c b/libswscale/graph.c
index 2d07c4bb06..b44964e625 100644
--- a/libswscale/graph.c
+++ b/libswscale/graph.c
@@ -152,7 +152,9 @@ static void run_copy(const SwsImg *out_base, const SwsImg 
*in_base,
         const int lines = h >> ff_fmt_vshift(in.fmt, i);
         av_assert1(in.data[i]);
 
-        if (in.linesize[i] == out.linesize[i]) {
+        if (in.data[i] == out.data[i]) {
+            av_assert0(in.linesize[i] == out.linesize[i]);
+        } else if (in.linesize[i] == out.linesize[i]) {
             memcpy(out.data[i], in.data[i], lines * out.linesize[i]);
         } else {
             const int linesize = FFMIN(out.linesize[i], in.linesize[i]);

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

Reply via email to