[FFmpeg-devel] Patch for heap corruption run time error in decklink_common.cpp

Michael Niedermayer michaelni at gmx.at
Wed Dec 3 00:51:36 CET 2014


On Wed, Dec 03, 2014 at 12:35:32AM +0100, Ramiro Polla wrote:
> 
> On 02.12.2014 20:28, Jon bae wrote:
> >Ok here a second run, I try to follow the instruction from Carl Eugen.
> >This is the first patch for decklink_common.cpp. It fix this error:
> >
> >    Unhandled exception at 0x0000000076FA4102 (ntdll.dll) in ffmpeg.exe:
> >    0xC0000374: A heap has been corrupted (parameters: 0x000000007701B4B0).
> 
> >From e9bc8e910f515af4030054df3e6feb308f3208aa Mon Sep 17 00:00:00 2001
> >From: Jonathan Baecker <jonbae77 at gmail.com>
> >Date: Tue, 2 Dec 2014 20:10:41 +0100
> >Subject: [PATCH 1/2] heap corruption run time error in decklink_common
> >
> >Signed-off-by: Jonathan Baecker <jonbae77 at gmail.com>
> >---
> > 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..8eff910 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;
> > }
> 
> LGTM

applied

thanks

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20141203/de546624/attachment.asc>


More information about the ffmpeg-devel mailing list