Skip to content
Snippets Groups Projects
Commit 5a57f389 authored by Jonathan Baecker's avatar Jonathan Baecker Committed by Michael Niedermayer
Browse files

avdevice/decklink_common: fix heap corruption run time error

parent 7a4be431
Branches
Tags
No related merge requests found
...@@ -69,9 +69,12 @@ static char *dup_wchar_to_utf8(wchar_t *w) ...@@ -69,9 +69,12 @@ static char *dup_wchar_to_utf8(wchar_t *w)
} }
#define DECKLINK_STR OLECHAR * #define DECKLINK_STR OLECHAR *
#define DECKLINK_STRDUP dup_wchar_to_utf8 #define DECKLINK_STRDUP dup_wchar_to_utf8
#define DECKLINK_FREE(s) SysFreeString(s)
#else #else
#define DECKLINK_STR const char * #define DECKLINK_STR const char *
#define DECKLINK_STRDUP av_strdup #define DECKLINK_STRDUP av_strdup
/* free() is needed for a string returned by the DeckLink SDL. */
#define DECKLINK_FREE(s) free((void *) s)
#endif #endif
HRESULT ff_decklink_get_display_name(IDeckLink *This, const char **displayName) HRESULT ff_decklink_get_display_name(IDeckLink *This, const char **displayName)
...@@ -81,8 +84,7 @@ HRESULT ff_decklink_get_display_name(IDeckLink *This, const char **displayName) ...@@ -81,8 +84,7 @@ HRESULT ff_decklink_get_display_name(IDeckLink *This, const char **displayName)
if (hr != S_OK) if (hr != S_OK)
return hr; return hr;
*displayName = DECKLINK_STRDUP(tmpDisplayName); *displayName = DECKLINK_STRDUP(tmpDisplayName);
/* free() is needed for a string returned by the DeckLink SDL. */ DECKLINK_FREE(tmpDisplayName);
free((void *) tmpDisplayName);
return hr; return hr;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment