typefindfunctions: fix crash in new MSS typefinder
authorTim-Philipp Müller <tim@centricular.net>
Tue, 23 Apr 2013 23:08:15 +0000 (00:08 +0100)
committerTim-Philipp Müller <tim@centricular.net>
Tue, 23 Apr 2013 23:08:15 +0000 (00:08 +0100)
Fixes icydemux test_first_buf_offset_when_merged_for_typefinding
unit test segfaulting on a NULL pointer.

gst/typefind/gsttypefindfunctions.c

index b3134d5..5fe0101 100644 (file)
@@ -3279,6 +3279,9 @@ mss_manifest_type_find (GstTypeFind * tf, gpointer unused)
     /* try detecting the charset */
     data = gst_type_find_peek (tf, 0, 2);
 
+    if (data == NULL)
+      return;
+
     /* look for a possible BOM */
     utf16_le = data[0] == 0xFF && data[1] == 0xFE;
     utf16_be = data[0] == 0xFE && data[1] == 0xFF;