avutil/opt: ensure the right buffer is used in set_string_number()
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 25 Jul 2014 19:29:43 +0000 (21:29 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 25 Jul 2014 19:29:43 +0000 (21:29 +0200)
Fixes use of uninitialized memory

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavutil/opt.c

index c1ca4a8..2a06eb6 100644 (file)
@@ -206,7 +206,7 @@ static int set_string_number(void *obj, void *target_obj, const AVOption *o, con
         }
 
         {
-            const AVOption *o_named = av_opt_find(target_obj, buf, o->unit, 0, 0);
+            const AVOption *o_named = av_opt_find(target_obj, i ? buf : val, o->unit, 0, 0);
             int res;
             int ci = 0;
             double const_values[64];