From 2db8d6ea0bc3b6bd4eab91b167c5af790e1a6e0f Mon Sep 17 00:00:00 2001 From: Aleksey Yulin Date: Thu, 16 Jul 2009 19:49:26 +0200 Subject: mpegtsdemux: Don't use PIDs > MPEGTS_MAX_PID The mpegtsdemux streams array only has MPEGTS_MAX_PID entries and accessing one afterwards will result in crashes. Fixes bug #575672. --- gst/mpegdemux/gstmpegtsdemux.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gst/mpegdemux') diff --git a/gst/mpegdemux/gstmpegtsdemux.c b/gst/mpegdemux/gstmpegtsdemux.c index cb082a2b..65539d0a 100644 --- a/gst/mpegdemux/gstmpegtsdemux.c +++ b/gst/mpegdemux/gstmpegtsdemux.c @@ -1697,7 +1697,8 @@ gst_mpegts_demux_parse_adaptation_field (GstMpegTSStream * stream, memset (pmts_checked, 0, sizeof (gboolean) * (MPEGTS_MAX_PID + 1)); for (j = 0; j < MPEGTS_MAX_PID + 1; j++) { - if (demux->streams[j] && demux->streams[j]->PMT_pid) { + if (demux->streams[j] + && demux->streams[j]->PMT_pid <= MPEGTS_MAX_PID) { if (!pmts_checked[demux->streams[j]->PMT_pid]) { /* check if this is correct pcr for pmt */ if (demux->streams[demux->streams[j]->PMT_pid] && -- cgit v1.2.1