typefinding: check for full UTF-8 BOM in MSS typefinder
authorTim-Philipp Müller <tim@centricular.com>
Thu, 11 Jun 2015 22:32:55 +0000 (23:32 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Thu, 11 Jun 2015 22:33:30 +0000 (23:33 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=750802

gst/typefind/gsttypefindfunctions.c

index def9217a6d81b0ba77e2ae0f737288d5924762cc..024650ccc5be6d1fa7065108fff91095cab5f8e6 100644 (file)
@@ -3590,13 +3590,13 @@ mss_manifest_type_find (GstTypeFind * tf, gpointer unused)
   length = gst_type_find_get_length (tf);
 
   /* try detecting the charset */
-  data = gst_type_find_peek (tf, 0, 2);
+  data = gst_type_find_peek (tf, 0, 3);
 
   if (data == NULL)
     return;
 
   /* look for a possible BOM */
-  if (data[0] == 0xEF && data[1] == 0xBB)
+  if (data[0] == 0xEF && data[1] == 0xBB && data[2] == 0xBF)
     utf8_bom_detected = TRUE;
   else if (data[0] == 0xFF && data[1] == 0xFE)
     data_endianness = G_LITTLE_ENDIAN;