From ed743952188a86293051c354704f178073226399 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Tue, 20 Aug 2019 00:30:04 +0530 Subject: [PATCH] rtmp: Fix crash inside free() with MSVC on Windows librtmp is always built with MinGW in Cerbero, so if the plugin is built with MSVC and it frees memory allocated by librtmp, that leads to a crash since the CRT used by MinGW and MSVC are different. This is fixed in master by switching to a newer GCC toolchain which has been configured to use the same CRT as newer versions of Visual Studio, so there's no cross-CRT memory alloc/free issues. See: https://gitlab.freedesktop.org/gstreamer/cerbero/issues/164 --- ext/rtmp/gstrtmpsrc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ext/rtmp/gstrtmpsrc.c b/ext/rtmp/gstrtmpsrc.c index 0ad97ab..9470ad3 100644 --- a/ext/rtmp/gstrtmpsrc.c +++ b/ext/rtmp/gstrtmpsrc.c @@ -243,11 +243,15 @@ gst_rtmp_src_uri_set_uri (GstURIHandler * handler, const gchar * uri, GST_ERROR_OBJECT (src, "Failed to parse URI %s", uri); g_set_error (error, GST_URI_ERROR, GST_URI_ERROR_BAD_URI, "Could not parse RTMP URI"); +#ifndef _MSC_VER /* FIXME: we should not be freeing RTMP internals to avoid leaking */ free (playpath.av_val); +#endif return FALSE; } +#ifndef _MSC_VER free (playpath.av_val); +#endif src->uri = g_strdup (uri); } -- 2.7.4