changeset 4852:534e7b5aaadb

mem corruption bug fix.
author pontscho
date Sun, 24 Feb 2002 21:57:16 +0000
parents f85d5a17d782
children 2853640cea58
files Gui/interface.h mplayer.c
diffstat 2 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Gui/interface.h	Sun Feb 24 21:27:47 2002 +0000
+++ b/Gui/interface.h	Sun Feb 24 21:57:16 2002 +0000
@@ -95,6 +95,7 @@
 
 #define guiXEvent 0
 #define guiCEvent 1
+#define guiIEvent 2
 
 extern void guiInit( int argc,char* argv[], char *envp[] );
 extern void guiGetEvent( int type,char * arg );
@@ -102,7 +103,7 @@
 
 #define gstrdup( s,ss ) { s=malloc( strlen( ss ) + 3 ); strcpy( s,ss ); }
 
-#define guiSetFilename( s,n ) { s=strdup( n ); }
+#define guiSetFilename( s,n ) { if ( s ) free( s ); s=strdup( n ); }
 
 #define guiSetDF( s,d,n )                       \
  {                                              \
--- a/mplayer.c	Sun Feb 24 21:27:47 2002 +0000
+++ b/mplayer.c	Sun Feb 24 21:57:16 2002 +0000
@@ -1415,7 +1415,7 @@
      guiIntfStruct.MovieWidth=sh_video->disp_w;
      guiIntfStruct.MovieHeight=sh_video->disp_h;
      guiIntfStruct.StreamType=stream->type;
-     guiIntfStruct.Filename=filename;
+     guiSetFilename( guiIntfStruct.Filename,filename );
     }
 #endif