diff mbox series

[FFmpeg-devel,2/2] fftools/ffmpeg_filter: initialize the 'o' to silence the warning

Message ID 20230225152658.3086653-2-mypopydev@gmail.com
State Accepted
Commit a0a0a804998da8d1a397479c9bafeb000e6be088
Headers show
Series [FFmpeg-devel,1/2] lavfi/coreimage: suppress OpenGL deprecation warning | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Jun Zhao Feb. 25, 2023, 3:26 p.m. UTC
From: Jun Zhao <barryjzhao@tencent.com>

silence the warning: variable 'o' is used uninitialized whenever
'&&' condition is false

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
---
 fftools/ffmpeg_filter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Thilo Borgmann Feb. 25, 2023, 5:49 p.m. UTC | #1
Am 25.02.23 um 16:26 schrieb Jun Zhao:
> From: Jun Zhao <barryjzhao@tencent.com>
> 
> silence the warning: variable 'o' is used uninitialized whenever
> '&&' condition is false
> 
> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
> ---
>   fftools/ffmpeg_filter.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

LGTM.

-Thilo
Dominik 'Rathann' Mierzejewski Oct. 9, 2023, 9:01 p.m. UTC | #2
On Saturday, 25 February 2023 at 18:49, Thilo Borgmann wrote:
> Am 25.02.23 um 16:26 schrieb Jun Zhao:
> > From: Jun Zhao <barryjzhao@tencent.com>
> > 
> > silence the warning: variable 'o' is used uninitialized whenever
> > '&&' condition is false
> > 
> > Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
> > ---
> >   fftools/ffmpeg_filter.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> LGTM.

Sorry to dig up an old thread, but this actually fixes a segmentation
fault when passing a non-existent filter option, so please make sure
it's back-ported to the next 6.0.x release.

To reproduce:
ffmpeg -y -f rawvideo -s 1x1 -i /dev/zero -vf palettegen=doesnt_exist=64 dummy.png

This was reported in RPM Fusion bugzilla:
https://bugzilla.rpmfusion.org/show_bug.cgi?id=6773

5.1.3 is not affected, only 6.0.

Regards,
Dominik
diff mbox series

Patch

diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index 1f5bbf6c4d..3504a3cc0a 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -362,7 +362,7 @@  fail:
 
 static int filter_opt_apply(AVFilterContext *f, const char *key, const char *val)
 {
-    const AVOption *o;
+    const AVOption *o = NULL;
     int ret;
 
     ret = av_opt_set(f, key, val, AV_OPT_SEARCH_CHILDREN);