summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hervey <edward@collabora.com>2013-07-08 08:44:43 +0200
committerEdward Hervey <edward@collabora.com>2013-07-09 12:25:11 +0200
commit8ca1751f00455c4965e67c447aa3b0a4754dbc88 (patch)
tree763026552bcbf627fcc44a452baa0869e1874f2a
parent0ef3e3c7d253727f1e0c5fd704927e3510d008b8 (diff)
downloadgstreamer-plugins-bad-8ca1751f00455c4965e67c447aa3b0a4754dbc88.tar.gz
mpegtsdemux: Avoid parsing section without enough data
This is actually a workaround (we'll be skipping the upcoming section) This will only happen for sections where the beginning is located within the last 8 bytes of a packet (which is the minimum we need to properly identify any section beginning). Later we should figure out a way to store those bytes and mark that some analysis needs to happen. The probability of this happening is too low for me to care right now and do that fix. There is a good chance that section will eventually be repeated and won't end up on such border.
-rw-r--r--gst/mpegtsdemux/mpegtspacketizer.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gst/mpegtsdemux/mpegtspacketizer.c b/gst/mpegtsdemux/mpegtspacketizer.c
index 0c1841dd8..2432469c2 100644
--- a/gst/mpegtsdemux/mpegtspacketizer.c
+++ b/gst/mpegtsdemux/mpegtspacketizer.c
@@ -972,7 +972,9 @@ accumulate_data:
res = section;
}
- if (data == packet->data_end || *data == 0xff) {
+ /* FIXME : We need at least 8 bytes with current algorithm :(
+ * We might end up losing sections that start across two packets (srsl...) */
+ if (data > packet->data_end - 8 || *data == 0xff) {
/* flush stuffing bytes and leave */
mpegts_packetizer_clear_section (stream);
goto out;