[FFmpeg-cvslog] avdevice/decklink_common: fix heap corruption run time error

Jonathan Baecker git at videolan.org
Wed Dec 3 00:48:49 CET 2014


ffmpeg | branch: master | Jonathan Baecker <jonbae77 at gmail.com> | Tue Dec  2 20:10:41 2014 +0100| [5a57f389f45e9d6663746d7f060cccee7db04f16] | committer: Michael Niedermayer

avdevice/decklink_common: fix heap corruption run time error

Signed-off-by: Jonathan Baecker <jonbae77 at gmail.com>
Reviewed-by: Ramiro Polla <ramiro.polla at gmail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5a57f389f45e9d6663746d7f060cccee7db04f16
---

 libavdevice/decklink_common.cpp |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavdevice/decklink_common.cpp b/libavdevice/decklink_common.cpp
index 9a9e44b..6899bd2 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;
 }
 



More information about the ffmpeg-cvslog mailing list