diff --git a/gst/multipart/multipartdemux.c b/gst/multipart/multipartdemux.c
index 525143c..c4e6a5f 100644
--- a/gst/multipart/multipartdemux.c
+++ b/gst/multipart/multipartdemux.c
@@ -404,9 +404,11 @@ multipart_parse_header (GstMultipartDemux * multipart)
     return MULTIPART_NEED_MORE_DATA;
   }
 
-  if (G_UNLIKELY (pos[0] != '-' || pos[1] != '-')) {
-    GST_DEBUG_OBJECT (multipart, "No boundary available");
-    goto wrong_header;
+  if (G_UNLIKELY (multipart->boundary == NULL)) {
+    if (G_UNLIKELY (pos[0] != '-' || pos[1] != '-')) {
+      GST_DEBUG_OBJECT (multipart, "No boundary available");
+      goto wrong_header;
+    }
   }
 
   /* First the boundary */
@@ -416,9 +418,11 @@ multipart_parse_header (GstMultipartDemux * multipart)
   /* Ignore the leading -- */
   boundary_len = end - pos - 2;
   boundary = (gchar *) pos + 2;
-  if (boundary_len < 1) {
-    GST_DEBUG_OBJECT (multipart, "No boundary available");
-    goto wrong_header;
+  if (G_UNLIKELY (multipart->boundary == NULL)) {
+    if (boundary_len < 1) {
+      GST_DEBUG_OBJECT (multipart, "No boundary available");
+      goto wrong_header;
+    }
   }
 
   if (G_UNLIKELY (multipart->boundary == NULL)) {
@@ -436,11 +440,15 @@ multipart_parse_header (GstMultipartDemux * multipart)
     GST_DEBUG_OBJECT (multipart,
         "Boundary length doesn't match detected boundary (%d <> %d",
         boundary_len, multipart->boundary_len);
+  if (G_UNLIKELY (multipart->boundary == NULL)) {
     goto wrong_header;
+  }
   } else if (G_UNLIKELY (strncmp (boundary, multipart->boundary, boundary_len))) {
     GST_DEBUG_OBJECT (multipart, "Boundary doesn't match previous boundary");
+  if (G_UNLIKELY (multipart->boundary == NULL)) {
     goto wrong_header;
   }
+  }
 
 
   pos = next;
