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
6969 }
7070 #define DECKLINK_STR OLECHAR *
7171 #define DECKLINK_STRDUP dup_wchar_to_utf8
72+#define DECKLINK_FREE(s) SysFreeString(s)
7273 #else
7374 #define DECKLINK_STR const char *
7475 #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)
7578 #endif
7679
7780 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) · 3 unmodified lines
8184 if (hr != S_OK)
8285 return hr;
8386 *displayName = DECKLINK_STRDUP(tmpDisplayName);
84− /* free() is needed for a string returned by the DeckLink SDL. */
85− free((void *) tmpDisplayName);
87+ DECKLINK_FREE(tmpDisplayName);
8688 return hr;
8789 }
8890

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