1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-18 21:06:00 +00:00

Avoid buffer overflow: memory has do be allocated accordingly when overwriting a string!

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19954 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2006-09-23 14:36:25 +00:00
parent c466bd5d89
commit 4137480167

View File

@ -562,14 +562,21 @@ static LRESULT CALLBACK PrefsWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM
return 0;
case ID_APPLY:
{
int strl;
if(guiIntfStruct.Playing) guiGetEvent(guiCEvent, (void *)guiSetStop);
/* Set the video driver */
SendMessage(vo_driver, CB_GETLBTEXT, (WPARAM)SendMessage(vo_driver, CB_GETCURSEL, 0, 0),
gfree(video_driver_list[0]);
strl = SendMessage(vo_driver, CB_GETCURSEL, 0, 0);
video_driver_list[0] = malloc(strl);
SendMessage(vo_driver, CB_GETLBTEXT, (WPARAM)strl,
(LPARAM)video_driver_list[0]);
/* Set the audio driver */
SendMessage(ao_driver, CB_GETLBTEXT, (WPARAM)SendMessage(ao_driver, CB_GETCURSEL, 0, 0),
gfree(audio_driver_list[0]);
strl = SendMessage(ao_driver, CB_GETCURSEL, 0, 0);
audio_driver_list[0] = malloc(strl);
SendMessage(ao_driver, CB_GETLBTEXT, (WPARAM)strl,
(LPARAM)audio_driver_list[0]);
/* Set the priority level */