Make av_set_string() fail when number could not be set.
authorStefano Sabatini <stefano.sabatini-lala@poste.it>
Thu, 15 May 2008 01:03:48 +0000 (01:03 +0000)
committerBenoit Fouet <benoit.fouet@free.fr>
Thu, 15 May 2008 01:03:48 +0000 (01:03 +0000)
Patch by Stefano Sabatini stefano§sabatini-lalaATposte§it

Originally committed as revision 13155 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/opt.c

index d8b1b0de064bf4f4ba50e2e4af53610638f19f25..94ac62218034dcf62927f9d01c032dc51c0e6934 100644 (file)
@@ -182,7 +182,8 @@ const AVOption *av_set_string(void *obj, const char *name, const char *val){
             }else if(cmd=='-')
                 d= -d;
 
-            av_set_number(obj, name, d, 1, 1);
+            if (!av_set_number(obj, name, d, 1, 1))
+                return NULL;
             val+= i;
             if(!*val)
                 return o;