[PATCH] libavfilter/vf_bilateral: check slice_factor_b/line_factor_b allocations

Anas Khan via ffmpeg-devel <[email protected]> Thu, 2 Jul 2026 23:03:49 +0530
Newsgroups gmane.comp.video.ffmpeg.devel
Message-ID <[email protected]>
The ENOMEM check in config_input() tested slice_factor_a and line_factor_a
twice each due to a copy-paste error, leaving the slice_factor_b and
line_factor_b allocations unchecked. Both buffers are dereferenced
unconditionally in the filter kernel, so an allocation failure resulted in
a NULL pointer dereference instead of a clean AVERROR(ENOMEM).

Signed-off-by: Anas Khan <[email protected]>
---
 libavfilter/vf_bilateral.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_bilateral.c b/libavfilter/vf_bilateral.c
index 0a08a6d6d6..ef6dad1ebf 100644
--- a/libavfilter/vf_bilateral.c
+++ b/libavfilter/vf_bilateral.c
@@ -142,9 +142,9 @@ static int config_input(AVFilterLink *inlink)
             !s->map_factor_a[p] ||
             !s->map_factor_b[p] ||
             !s->slice_factor_a[p] ||
-            !s->slice_factor_a[p] ||
+            !s->slice_factor_b[p] ||
             !s->line_factor_a[p] ||
-            !s->line_factor_a[p])
+            !s->line_factor_b[p])
             return AVERROR(ENOMEM);
     }
 
-- 
2.54.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.