[tbb-commits] [tor-browser/tor-browser-31.7.0esr-4.5-1] Bug 16026: Fix crash in GStreamer

gk at torproject.org gk at torproject.org
Wed May 27 07:24:12 UTC 2015


commit 9b5866c548c768b2a604d43896ce74e2a40848d0
Author: Georg Koppen <gk at torproject.org>
Date:   Fri May 22 07:38:56 2015 +0000

    Bug 16026: Fix crash in GStreamer
    
    This is a backport of the patch attached to Mozilla's bug 1145230
    (https://bugzilla.mozilla.org/show_bug.cgi?id=1145230).
---
 content/media/gstreamer/GStreamerReader.cpp |   15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/content/media/gstreamer/GStreamerReader.cpp b/content/media/gstreamer/GStreamerReader.cpp
index e17f767..b9ba73b 100644
--- a/content/media/gstreamer/GStreamerReader.cpp
+++ b/content/media/gstreamer/GStreamerReader.cpp
@@ -220,12 +220,15 @@ void GStreamerReader::ElementAddedCb(GstBin *aPlayBin,
                                      GstElement *aElement,
                                      gpointer aUserData)
 {
-  const gchar *name =
-    gst_plugin_feature_get_name(GST_PLUGIN_FEATURE(gst_element_get_factory(aElement)));
-
-  if (!strcmp(name, "uridecodebin")) {
-    g_signal_connect(G_OBJECT(aElement), "autoplug-sort",
-                     G_CALLBACK(GStreamerReader::ElementFilterCb), aUserData);
+  GstElementFactory *factory = gst_element_get_factory(aElement);
+  if (factory) {
+    const gchar *name =
+      gst_plugin_feature_get_name(GST_PLUGIN_FEATURE(factory));
+
+    if (!strcmp(name, "uridecodebin")) {
+      g_signal_connect(G_OBJECT(aElement), "autoplug-sort",
+                       G_CALLBACK(GStreamerReader::ElementFilterCb), aUserData);
+    }
   }
 }
 



More information about the tbb-commits mailing list