mpegtssection: Don't assert if the given section length is longer than the PMT actual...
authorSebastian Dröge <sebastian@centricular.com>
Mon, 28 Nov 2016 17:52:24 +0000 (19:52 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Mon, 28 Nov 2016 17:53:46 +0000 (19:53 +0200)
Instead error out cleanly and just assert that we didn't read more than
the available data.

gst-libs/gst/mpegts/gstmpegtssection.c

index cc5e21b..02038a7 100644 (file)
@@ -715,6 +715,11 @@ _parse_pmt (GstMpegtsSection * section)
     i += 1;
   }
 
+  /* Section length was longer than the actual content of the PMT */
+  if (data <= end - 4)
+    goto error;
+
+  /* Ensure we did not read after the end of our array */
   g_assert (data == end - 4);
 
   return (gpointer) pmt;