typefindfunctions: Check for NULL return of gst_type_find_peek() instead of segfaulti...
authorSebastian Dröge <sebastian@centricular.com>
Tue, 23 Jul 2019 10:54:24 +0000 (13:54 +0300)
committerSebastian Dröge <sebastian@centricular.com>
Tue, 23 Jul 2019 10:54:24 +0000 (13:54 +0300)
See https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/merge_requests/329#note_194943

gst/typefind/gsttypefindfunctions.c

index b343f00..e4277fd 100644 (file)
@@ -756,6 +756,9 @@ otio_type_find (GstTypeFind * tf, gpointer unused)
     return;
 
   data = (const gchar *) gst_type_find_peek (tf, tmp - data, 15);
+  if (!data)
+    return;
+
   if (memcmp (data, "\"OTIO_SCHEMA\":", 15)) {
     gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, OTIO_CAPS);
   }