[FFmpeg-devel] [PATCH] lavfi/gradfun: avoid use of uninitialized variable.

Clément Bœsch ubitux at gmail.com
Sun Dec 2 02:26:23 CET 2012


---
Strangely this is not detected by GCC or Clang, but unless I'm mistaken,
direct can be used unitialized at the end of the function.
---
 libavfilter/vf_gradfun.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/vf_gradfun.c b/libavfilter/vf_gradfun.c
index 265d3ee..260a44b 100644
--- a/libavfilter/vf_gradfun.c
+++ b/libavfilter/vf_gradfun.c
@@ -187,7 +187,7 @@ static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *in)
     GradFunContext *gf = inlink->dst->priv;
     AVFilterLink *outlink = inlink->dst->outputs[0];
     AVFilterBufferRef *out;
-    int p, direct;
+    int p, direct = 0;
 
     if ((in->perms & AV_PERM_WRITE) && !(in->perms & AV_PERM_PRESERVE)) {
         direct = 1;
-- 
1.8.0.1



More information about the ffmpeg-devel mailing list