[PR] avfilter/spectrumsynth: negotiate one pixel format for both inputs (PR #24101)

michaelni via ffmpeg-devel <[email protected]>
Newsgroups gmane.comp.video.ffmpeg.devel
Message-ID <178649511973.59.4197734080805978885@29965ddac10e>
PR #24101 opened by michaelni
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24101
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24101.patch

Fixes: out of array access
Fixes: ndSS0e433gq
Found-by: Eunsoo Kim, Microsoft FORGE Labs



>From 4f2fe033dfa78dc41fef2d26b9598da20bfc5864 Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <[email protected]>
Date: Wed, 12 Aug 2026 02:24:41 +0200
Subject: [PATCH] avfilter/spectrumsynth: negotiate one pixel format for both
 inputs

Fixes: out of array access
Fixes: ndSS0e433gq
Found-by: Eunsoo Kim, Microsoft FORGE Labs
---
 libavfilter/vaf_spectrumsynth.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/libavfilter/vaf_spectrumsynth.c b/libavfilter/vaf_spectrumsynth.c
index 8873062e23..0a750fbda0 100644
--- a/libavfilter/vaf_spectrumsynth.c
+++ b/libavfilter/vaf_spectrumsynth.c
@@ -127,13 +127,8 @@ static int query_formats(const AVFilterContext *ctx,
     formats = ff_make_pixel_format_list(pix_fmts);
     if (!formats)
         return AVERROR(ENOMEM);
-    if ((ret = ff_formats_ref(formats, &cfg_in[MAGNITUDE]->formats)) < 0)
-        return ret;
-
-    formats = ff_make_pixel_format_list(pix_fmts);
-    if (!formats)
-        return AVERROR(ENOMEM);
-    if ((ret = ff_formats_ref(formats, &cfg_in[PHASE]->formats)) < 0)
+    if ((ret = ff_formats_ref(formats, &cfg_in[MAGNITUDE]->formats)) < 0 ||
+        (ret = ff_formats_ref(formats, &cfg_in[PHASE]->formats)) < 0)
         return ret;
 
     return 0;
-- 
2.52.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.