History

avdevice/decklink_common: fix heap corruption run time error

Jonathan Baecker committed 11 years ago

Commit 5a57f381 parent 7a4be431 file · +4 −2Browse files

Showing the changes to libavdevice/decklink_common.cpp (1 of 1 file). Show all

Unified · Split

libavdevice/decklink_common.cpp+4−2
@@ -69,9 +69,12 @@ static char *dup_wchar_to_utf8(wchar_t *w) · 68 unmodified lines
69}69}
70#define DECKLINK_STR OLECHAR *70#define DECKLINK_STR OLECHAR *
71#define DECKLINK_STRDUP dup_wchar_to_utf871#define DECKLINK_STRDUP dup_wchar_to_utf8
72#define DECKLINK_FREE(s) SysFreeString(s)
72#else73#else
73#define DECKLINK_STR const char *74#define DECKLINK_STR const char *
74#define DECKLINK_STRDUP av_strdup75#define DECKLINK_STRDUP av_strdup
76/* free() is needed for a string returned by the DeckLink SDL. */
77#define DECKLINK_FREE(s) free((void *) s)
75#endif78#endif
76 79
77HRESULT ff_decklink_get_display_name(IDeckLink *This, const char **displayName)80HRESULT 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) · 3 unmodified lines
81 if (hr != S_OK)84 if (hr != S_OK)
82 return hr;85 return hr;
83 *displayName = DECKLINK_STRDUP(tmpDisplayName);86 *displayName = DECKLINK_STRDUP(tmpDisplayName);
84 /* free() is needed for a string returned by the DeckLink SDL. */87 DECKLINK_FREE(tmpDisplayName);
85 free((void *) tmpDisplayName);
86 return hr;88 return hr;
87}89}
88 90

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t