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

Git pushed a commit to branch master
in repository ffmpeg.

commit 6b751667583c392e3fd941e0691cdaf0e0284238
Author:     Niklas Haas <[email protected]>
AuthorDate: Sun May 17 13:14:18 2026 +0200
Commit:     Niklas Haas <[email protected]>
CommitDate: Tue Jun 9 01:10:54 2026 +0200

    swscale/tests/sws_ops: minor cleanup / consistency
    
    Clean up after the previous revert.
    
    Signed-off-by: Niklas Haas <[email protected]>
---
 libswscale/tests/sws_ops.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/libswscale/tests/sws_ops.c b/libswscale/tests/sws_ops.c
index bc353df8cb..f3fe518e96 100644
--- a/libswscale/tests/sws_ops.c
+++ b/libswscale/tests/sws_ops.c
@@ -96,6 +96,8 @@ int main(int argc, char **argv)
 {
     enum AVPixelFormat src_fmt = AV_PIX_FMT_NONE;
     enum AVPixelFormat dst_fmt = AV_PIX_FMT_NONE;
+    SwsContext *ctx = NULL;
+    SwsGraph *graph = NULL;
     int ret = 1;
 
 #ifdef _WIN32
@@ -147,28 +149,24 @@ bad_option:
         }
     }
 
-    SwsContext *ctx = sws_alloc_context();
+    /* Allocate dummy graph and context for ff_sws_compile_pass() */
+    graph = ff_sws_graph_alloc();
+    if (!graph)
+        goto fail;
+    graph->ctx = ctx = sws_alloc_context();
     if (!ctx)
         goto fail;
     ctx->scaler = SWS_SCALE_BILINEAR; /* reduce filter generation overhead */
 
     av_log_set_callback(log_stdout);
 
-    /* Allocate dummy graph and context for ff_sws_compile_pass() */
-    SwsGraph *graph = ff_sws_graph_alloc();
-    if (!graph) {
-        ret = AVERROR(ENOMEM);
-        goto fail;
-    }
-    graph->ctx = ctx;
-
     ret = ff_sws_enum_op_lists(ctx, graph, src_fmt, dst_fmt, print_passes);
-    ff_sws_graph_free(&graph);
     if (ret < 0)
         goto fail;
 
     ret = 0;
 fail:
     sws_free_context(&ctx);
+    ff_sws_graph_free(&graph);
     return ret;
 }

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

Reply via email to