From 911a6083c838ec3cddfb6f7011636fbb8e268451 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 28 Nov 2016 19:52:24 +0200 Subject: [PATCH] mpegtssection: Don't assert if the given section length is longer than the PMT actually is Instead error out cleanly and just assert that we didn't read more than the available data. --- gst-libs/gst/mpegts/gstmpegtssection.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gst-libs/gst/mpegts/gstmpegtssection.c b/gst-libs/gst/mpegts/gstmpegtssection.c index cc5e21b2ad..02038a76a0 100644 --- a/gst-libs/gst/mpegts/gstmpegtssection.c +++ b/gst-libs/gst/mpegts/gstmpegtssection.c @@ -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;