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

Git pushed a commit to branch master
in repository ffmpeg.

commit 517c3d5fc1d573b516833093ca0c4175da79dcd5
Author:     Niklas Haas <[email protected]>
AuthorDate: Fri Jun 5 21:08:12 2026 +0200
Commit:     Ramiro Polla <[email protected]>
CommitDate: Fri Jun 5 21:55:27 2026 +0200

    swscale/graph: re-check pixel format support in add_legacy_sws_pass()
    
    When the user passes multiple backends (e.g. SWS_BACKEND_ALL), the
    static check in sws_setup_frame() might have succeeded for the ops
    backend but not the legacy backend, so we need to properly restrict
    the legacy backend implementation function as well. Otherwise, this
    may trigger internal errors / AVERROR(EINVAL) inside sws_init_context().
    
    Sponsored-by: Sovereign Tech Fund
    Signed-off-by: Niklas Haas <[email protected]>
---
 libswscale/graph.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libswscale/graph.c b/libswscale/graph.c
index cd4498c91e..83e6787a01 100644
--- a/libswscale/graph.c
+++ b/libswscale/graph.c
@@ -555,6 +555,11 @@ static int add_legacy_sws_pass(SwsGraph *graph, const 
SwsFormat *src,
     if (src->hw_format != AV_PIX_FMT_NONE || dst->hw_format != AV_PIX_FMT_NONE)
         return AVERROR(ENOTSUP);
 
+    /* Re-check this here because this might not be excluded if the caller was
+     * testing against multiple backends */
+    if (!sws_isSupportedInput(src->format) || 
!sws_isSupportedOutput(dst->format))
+        return AVERROR(ENOTSUP);
+
     SwsContext *sws = sws_alloc_context();
     if (!sws)
         return AVERROR(ENOMEM);

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

Reply via email to