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 d8b1b0d..94ac622 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;