Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Baecker <jonbae77@gmail.com>2014-12-02 22:10:41 +0300
committerMichael Niedermayer <michaelni@gmx.at>2014-12-03 02:41:10 +0300
commit5a57f389f45e9d6663746d7f060cccee7db04f16 (patch)
treea00440850575ca12c86c0d3ea6916d7dab7f0b36 /libavdevice/decklink_common.cpp
parent7a4be4315fd6c5e80cd24697d1a5b67c9a3cfcaf (diff)
avdevice/decklink_common: fix heap corruption run time error
Signed-off-by: Jonathan Baecker <jonbae77@gmail.com> Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavdevice/decklink_common.cpp')
-rw-r--r--libavdevice/decklink_common.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavdevice/decklink_common.cpp b/libavdevice/decklink_common.cpp
index 9a9e44bf3c..6899bd29c9 100644
--- a/libavdevice/decklink_common.cpp
+++ b/libavdevice/decklink_common.cpp
@@ -69,9 +69,12 @@ static char *dup_wchar_to_utf8(wchar_t *w)
}
#define DECKLINK_STR OLECHAR *
#define DECKLINK_STRDUP dup_wchar_to_utf8
+#define DECKLINK_FREE(s) SysFreeString(s)
#else
#define DECKLINK_STR const char *
#define DECKLINK_STRDUP av_strdup
+/* free() is needed for a string returned by the DeckLink SDL. */
+#define DECKLINK_FREE(s) free((void *) s)
#endif
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)
return hr;
*displayName = DECKLINK_STRDUP(tmpDisplayName);
- /* free() is needed for a string returned by the DeckLink SDL. */
- free((void *) tmpDisplayName);
+ DECKLINK_FREE(tmpDisplayName);
return hr;
}