From 7e278e6b22fe2eea8b620996d6f3c7bbbb30c119 Mon Sep 17 00:00:00 2001 From: Vincent Penquerc'h Date: Wed, 11 Jun 2014 17:43:42 +0100 Subject: [PATCH] multipartdemux: guard against having no MIME type The code would previously crash trying to insert a NULL string into a hash table. It does seem a little broken that indexing is done by MIME type and not by index though, unless the spec says there cannot be two parts with the same MIME type. https://bugzilla.gnome.org/show_bug.cgi?id=659573 --- gst/multipart/multipartdemux.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gst/multipart/multipartdemux.c b/gst/multipart/multipartdemux.c index b44fee5d81..a62c2a06cf 100644 --- a/gst/multipart/multipartdemux.c +++ b/gst/multipart/multipartdemux.c @@ -621,6 +621,9 @@ gst_multipart_demux_chain (GstPad * pad, GstObject * parent, GstBuffer * buf) if (G_UNLIKELY (datalen <= 0)) { GST_DEBUG_OBJECT (multipart, "skipping empty content."); gst_adapter_flush (adapter, size - datalen); + } else if (G_UNLIKELY (!multipart->mime_type)) { + GST_DEBUG_OBJECT (multipart, "content has no MIME type."); + gst_adapter_flush (adapter, size - datalen); } else { GstClockTime ts;