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

Git pushed a commit to branch master
in repository ffmpeg.

The following commit(s) were added to refs/heads/master by this push:
     new b21f1b6482 tests/swscale: don't pass fake object to av_opt_eval_*
b21f1b6482 is described below

commit b21f1b6482b412edc06b20b2f5807c039081ee3a
Author:     Niklas Haas <[email protected]>
AuthorDate: Mon Feb 23 19:37:00 2026 +0100
Commit:     Niklas Haas <[email protected]>
CommitDate: Mon Feb 23 20:55:27 2026 +0000

    tests/swscale: don't pass fake object to av_opt_eval_*
    
    This is UB, as the fake object may be used for logging.
    
    Reported-by: Andreas Rheinhardt <[email protected]>
    Fixes: ea791a4ef17478693c231f04d8ba60985866f5bc
---
 libswscale/tests/swscale.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/libswscale/tests/swscale.c b/libswscale/tests/swscale.c
index 3e05c97bbf..6f6240e4b6 100644
--- a/libswscale/tests/swscale.c
+++ b/libswscale/tests/swscale.c
@@ -509,11 +509,6 @@ int main(int argc, char **argv)
     AVLFG rand;
     int ret = -1;
 
-    const AVClass *sws_class = sws_get_class();
-    const AVOption *flags_opt = av_opt_find(&sws_class, "sws_flags", NULL, 0,
-                                            AV_OPT_SEARCH_FAKE_OBJ);
-    av_assert0(flags_opt);
-
     for (int i = 1; i < argc; i += 2) {
         if (!strcmp(argv[i], "-help") || !strcmp(argv[i], "--help")) {
             fprintf(stderr,
@@ -581,7 +576,10 @@ int main(int argc, char **argv)
             opts.w = 1920;
             opts.h = 1080;
         } else if (!strcmp(argv[i], "-flags")) {
-            ret = av_opt_eval_flags(&sws_class, flags_opt, argv[i + 1], 
&opts.flags);
+            SwsContext *dummy = sws_alloc_context();
+            const AVOption *flags_opt = av_opt_find(dummy, "sws_flags", NULL, 
0, 0);
+            ret = av_opt_eval_flags(dummy, flags_opt, argv[i + 1], 
&opts.flags);
+            sws_free_context(&dummy);
             if (ret < 0) {
                 fprintf(stderr, "invalid flags %s\n", argv[i + 1]);
                 goto error;

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

Reply via email to