diff options
author | Edward Hervey <bilboed@bilboed.com> | 2009-05-25 16:27:34 +0200 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2009-05-25 18:32:26 +0200 |
commit | 410d8f891035656606382c423e57ae289c17a9be (patch) | |
tree | 9dcfa73e107e3acffcb89e8ef471be8464c724bf | |
parent | 849ea993587746eff034f5788569e7a991af716b (diff) | |
download | gst-plugins-bad-410d8f891035656606382c423e57ae289c17a9be.tar.gz gst-plugins-bad-410d8f891035656606382c423e57ae289c17a9be.tar.bz2 gst-plugins-bad-410d8f891035656606382c423e57ae289c17a9be.zip |
gstpesfilter: Don't peek the adapter if we don't have enough data.
-rw-r--r-- | gst/mpegdemux/gstpesfilter.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gst/mpegdemux/gstpesfilter.c b/gst/mpegdemux/gstpesfilter.c index a2a6b764..4285c940 100644 --- a/gst/mpegdemux/gstpesfilter.c +++ b/gst/mpegdemux/gstpesfilter.c @@ -167,6 +167,9 @@ gst_pes_filter_parse (GstPESFilter * filter) avail = MIN (avail, filter->length + 6); } + if (avail < 7) + goto need_more_data; + /* read more data, either the whole packet if there is a length * or whatever we have available if this in an unbounded packet. */ if (!(data = gst_adapter_peek (filter->adapter, avail))) @@ -198,9 +201,6 @@ gst_pes_filter_parse (GstPESFilter * filter) break; } - if (datalen < 1) - goto need_more_data; - filter->pts = filter->dts = -1; /* stuffing bits, first two bits are '10' for mpeg2 pes so this code is |