[MPlayer-cvslog] r36815 - trunk/gui/win32/preferences.c

ib subversion at mplayerhq.hu
Sat Feb 8 22:41:48 CET 2014


Author: ib
Date: Sat Feb  8 22:41:48 2014
New Revision: 36815

Log:
Fix usage of acp().

A call to acp() frees the previous string it has allocated which means
that there must not be two acp() calls as arguments to a function.

Based on a patch by Stephen Sheldon, sfsheldo gmail com.

Modified:
   trunk/gui/win32/preferences.c

Modified: trunk/gui/win32/preferences.c
==============================================================================
--- trunk/gui/win32/preferences.c	Sat Feb  8 21:41:35 2014	(r36814)
+++ trunk/gui/win32/preferences.c	Sat Feb  8 22:41:48 2014	(r36815)
@@ -543,6 +543,8 @@ static LRESULT CALLBACK PrefsWndProc(HWN
                 case ID_APPLY:
                 {
                     int strl;
+                    char *caption;
+
                     if(guiInfo.Playing) gui(GUI_SET_STATE, (void *)GUI_STOP);
 
                     /* Set the video driver */
@@ -632,7 +634,9 @@ static LRESULT CALLBACK PrefsWndProc(HWN
                     else if(SendDlgItemMessage(hwnd, ID_OSD3, BM_GETCHECK, 0, 0) == BST_CHECKED)
                         osd_level = 3;
 
-                    MessageBox(hwnd, acp(MSGTR_GUI_MSG_PlaybackNeedsRestart), acp(MSGTR_GUI_Warning), MB_OK);
+                    caption = strdup(acp(MSGTR_GUI_Warning));
+                    MessageBox(hwnd, acp(MSGTR_GUI_MSG_PlaybackNeedsRestart), caption, MB_OK);
+                    free(caption);
                     DestroyWindow(hwnd);
                     break;
                 }


More information about the MPlayer-cvslog mailing list