summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-05-19 17:58:17 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-05-19 17:58:17 +0000
commit7be96c379227b2a24cf8874e3f037263000d6e58 (patch)
treef644f0ebfc8dcfaac62c7061f01eaecbac452b73 /libvo
parentd08822aaac791eabbd80bf79a0643ecbdf25b693 (diff)
downloadmpv-7be96c379227b2a24cf8874e3f037263000d6e58.tar.bz2
mpv-7be96c379227b2a24cf8874e3f037263000d6e58.tar.xz
Do not return pointer to on-stack memory.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31184 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/w32_common.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libvo/w32_common.c b/libvo/w32_common.c
index 0f737599ad..c31a5454f5 100644
--- a/libvo/w32_common.c
+++ b/libvo/w32_common.c
@@ -410,6 +410,7 @@ int vo_w32_config(uint32_t width, uint32_t height, uint32_t flags) {
/**
* \brief return the name of the selected device if it is indepedant
+ * \return pointer to string, must be freed.
*/
static char *get_display_name(void) {
DISPLAY_DEVICE disp;
@@ -417,7 +418,7 @@ static char *get_display_name(void) {
EnumDisplayDevices(NULL, vo_adapter_num, &disp, 0);
if (disp.StateFlags & DISPLAY_DEVICE_ATTACHED_TO_DESKTOP)
return NULL;
- return disp.DeviceName;
+ return strdup(disp.DeviceName);
}
/**
@@ -495,6 +496,7 @@ int vo_w32_init(void) {
dev_hdc = 0;
dev = get_display_name();
if (dev) dev_hdc = CreateDC(dev, NULL, NULL, NULL);
+ free(dev);
updateScreenProperties();
vo_hdc = vo_w32_get_dc(vo_window);