From: RĂ©mi Duraffort Date: Fri, 26 Jun 2009 07:27:23 +0000 (+0200) Subject: DynamicOverlay: fix crash (invalid free). X-Git-Tag: 1.1.0-ff~5238 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=1446509e7b3d2226a2fc054399114be8e695c506;p=vlc DynamicOverlay: fix crash (invalid free). The string given in a callback must be copied. --- diff --git a/modules/video_filter/dynamicoverlay/dynamicoverlay.c b/modules/video_filter/dynamicoverlay/dynamicoverlay.c index c4301c12f5..6ab22e6278 100644 --- a/modules/video_filter/dynamicoverlay/dynamicoverlay.c +++ b/modules/video_filter/dynamicoverlay/dynamicoverlay.c @@ -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; }