diff options
author | Zaheer Abbas Merali <zaheerabbas@merali.org> | 2008-10-16 08:13:49 +0000 |
---|---|---|
committer | Zaheer Abbas Merali <zaheerabbas@merali.org> | 2008-10-16 08:13:49 +0000 |
commit | 9a808ad30ae1de953b0c6813a53c02d14994de70 (patch) | |
tree | c65ee577ff0e4e7cb398f704183d133a57d61b6f | |
parent | f1c7c8cea0d06011c42875d588afe2c6781b60fb (diff) | |
download | gst-plugins-bad-9a808ad30ae1de953b0c6813a53c02d14994de70.tar.gz gst-plugins-bad-9a808ad30ae1de953b0c6813a53c02d14994de70.tar.bz2 gst-plugins-bad-9a808ad30ae1de953b0c6813a53c02d14994de70.zip |
gst/mpegdemux/gstmpegtsdemux.c: Fixes a segfault in the adaptation buffer size strategy.
Original commit message from CVS:
patch by: Josep Torra
* gst/mpegdemux/gstmpegtsdemux.c:
Fixes a segfault in the adaptation buffer size strategy.
Fixes #556440
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | gst/mpegdemux/gstmpegtsdemux.c | 11 |
2 files changed, 15 insertions, 4 deletions
@@ -1,3 +1,11 @@ +2008-10-15 Zaheer Abbas Merali <zaheerabbas at merali dot org> + + patch by: Josep Torra + + * gst/mpegdemux/gstmpegtsdemux.c: + Fixes a segfault in the adaptation buffer size strategy. + Fixes #556440 + 2008-10-15 Edward Hervey <edward.hervey@collabora.co.uk> * gst/selector/gstinputselector.c: (gst_input_selector_event), diff --git a/gst/mpegdemux/gstmpegtsdemux.c b/gst/mpegdemux/gstmpegtsdemux.c index 7ccbab8b..6ac05031 100644 --- a/gst/mpegdemux/gstmpegtsdemux.c +++ b/gst/mpegdemux/gstmpegtsdemux.c @@ -2206,19 +2206,22 @@ gst_fluts_demux_parse_stream (GstFluTSDemux * demux, GstFluTSStream * stream, GST_DEBUG_OBJECT (demux, "new PES start for PID 0x%04x, used %u" "bytes of %u bytes in the PES buffer", PID, stream->pes_buffer_used, stream->pes_buffer_size); + /* Flush buffered PES data */ + ret = gst_fluts_stream_pes_buffer_flush (stream); + gst_pes_filter_drain (&stream->filter); /* Resize the buffer to half if no overflow detected and * had been used less than half of it */ if (stream->pes_buffer_overflow == FALSE && stream->pes_buffer_used < (stream->pes_buffer_size >> 1)) { stream->pes_buffer_size >>= 1; + if (stream->pes_buffer_size < FLUTS_MIN_PES_BUFFER_SIZE) + stream->pes_buffer_size = FLUTS_MIN_PES_BUFFER_SIZE; GST_DEBUG_OBJECT (demux, "PES buffer size reduced to %u bytes", stream->pes_buffer_size); } + if (ret == GST_FLOW_LOST_SYNC) + goto done; stream->pes_buffer_overflow = FALSE; - - /* Flush buffered PES data */ - gst_fluts_stream_pes_buffer_flush (stream); - gst_pes_filter_drain (&stream->filter); } GST_LOG_OBJECT (demux, "Elementary packet of size %u for PID 0x%04x", datalen, PID); |