]> git.sesse.net Git - vlc/commitdiff
DynamicOverlay: fix crash (invalid free).
authorRémi Duraffort <ivoire@videolan.org>
Fri, 26 Jun 2009 07:27:23 +0000 (09:27 +0200)
committerRémi Duraffort <ivoire@videolan.org>
Fri, 26 Jun 2009 07:27:23 +0000 (09:27 +0200)
The string given in a callback must be copied.

modules/video_filter/dynamicoverlay/dynamicoverlay.c

index c4301c12f5aa36a6660f65fc162757a6559c91b3..6ab22e6278bc526b73286315cbcf70f8cacb7e41 100644 (file)
@@ -385,9 +385,15 @@ static int AdjustCallback( vlc_object_t *p_this, char const *psz_var,
     VLC_UNUSED(p_this); VLC_UNUSED(oldval);
 
     if( !strncmp( psz_var, "overlay-input", 13 ) )
-        p_sys->psz_inputfile = newval.psz_string;
+    {
+        free( p_sys->psz_inputfile );
+        p_sys->psz_inputfile = strdup( newval.psz_string );
+    }
     else if( !strncmp( psz_var, "overlay-output", 14 ) )
-        p_sys->psz_outputfile = newval.psz_string;
+    {
+        free( p_sys->psz_outputfile );
+        p_sys->psz_outputfile = strdup( newval.psz_string );
+    }
 
     return VLC_EGENERIC;
 }