diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2009-02-25 11:34:45 +0100 |
---|---|---|
committer | Wim Taymans <wim.taymans@collabora.co.uk> | 2009-02-25 11:34:45 +0100 |
commit | 9a0e1e0dca06d419af23d49ab87b681ae8313efc (patch) | |
tree | c255a9d0298d51a2606bc6f9e06a6b52bd11c308 | |
parent | 518d98899e2ce4282334afde057240d2ddb2b398 (diff) | |
download | gst-plugins-bad-9a0e1e0dca06d419af23d49ab87b681ae8313efc.tar.gz gst-plugins-bad-9a0e1e0dca06d419af23d49ab87b681ae8313efc.tar.bz2 gst-plugins-bad-9a0e1e0dca06d419af23d49ab87b681ae8313efc.zip |
mpegdemux: don't ignore GstFlowReturn values
don't ignore the return value of pull_range because we only get a valid non-NULL
buffer when the return value is GST_FLOW_OK. Avoids a crash when the pipeline is
shutting down.
-rw-r--r-- | gst/mpegdemux/gstmpegdemux.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gst/mpegdemux/gstmpegdemux.c b/gst/mpegdemux/gstmpegdemux.c index 87c251e4..1794cfc5 100644 --- a/gst/mpegdemux/gstmpegdemux.c +++ b/gst/mpegdemux/gstmpegdemux.c @@ -2195,6 +2195,9 @@ gst_flups_demux_scan_forward_ts (GstFluPSDemux * demux, guint64 * pos, /* read some data */ ret = gst_pad_pull_range (demux->sinkpad, offset, to_read, &buffer); + if (G_UNLIKELY (ret != GST_FLOW_OK)) + return FALSE; + data = GST_BUFFER_DATA (buffer); end_scan = GST_BUFFER_SIZE (buffer) - scan_sz; /* scan the block */ @@ -2242,6 +2245,9 @@ gst_flups_demux_scan_backward_ts (GstFluPSDemux * demux, guint64 * pos, } /* read some data */ ret = gst_pad_pull_range (demux->sinkpad, offset, to_read, &buffer); + if (G_UNLIKELY (ret != GST_FLOW_OK)) + return FALSE; + start_scan = GST_BUFFER_SIZE (buffer) - scan_sz; data = GST_BUFFER_DATA (buffer) + start_scan; /* scan the block */ |