Commit 513d480f authored by Wim Taymans's avatar Wim Taymans

don't pass random pointers to pull_range

parent 13983053
......@@ -282,7 +282,7 @@ static void
user_read_data (png_structp png_ptr, png_bytep data, png_size_t length)
{
GstPngDec *pngdec;
GstBuffer *buffer;
GstBuffer *buffer = NULL;
GstFlowReturn ret = GST_FLOW_OK;
guint size;
......
......@@ -2658,7 +2658,7 @@ gst_avi_demux_stream_index (GstAviDemux * avi)
{
GstFlowReturn res;
guint64 offset = avi->offset;
GstBuffer *buf;
GstBuffer *buf = NULL;
guint32 tag;
guint32 size;
GstMapInfo map;
......@@ -2685,6 +2685,7 @@ gst_avi_demux_stream_index (GstAviDemux * avi)
gst_buffer_unmap (buf, &map);
gst_buffer_unref (buf);
buf = NULL;
res = gst_pad_pull_range (avi->sinkpad, offset, 8, &buf);
if (res != GST_FLOW_OK)
goto pull_failed;
......@@ -3719,6 +3720,7 @@ gst_avi_demux_stream_header_pull (GstAviDemux * avi)
guint size;
guint32 tag, ltag;
buf = NULL;
res = gst_pad_pull_range (avi->sinkpad, avi->offset, 12, &buf);
if (res != GST_FLOW_OK) {
GST_DEBUG_OBJECT (avi, "pull_range failure while looking for tags");
......@@ -3800,6 +3802,7 @@ gst_avi_demux_stream_header_pull (GstAviDemux * avi)
case GST_MAKE_FOURCC ('J', 'U', 'N', 'K'):
/* Only get buffer for debugging if the memdump is needed */
if (gst_debug_category_get_threshold (GST_CAT_DEFAULT) >= 9) {
buf = NULL;
res = gst_pad_pull_range (avi->sinkpad, avi->offset, size, &buf);
if (res != GST_FLOW_OK) {
GST_DEBUG_OBJECT (avi, "couldn't read INFO chunk");
......@@ -4708,6 +4711,7 @@ gst_avi_demux_loop_data (GstAviDemux * avi)
/* FIXME, check large chunks and cut them up */
/* pull in the data */
buf = NULL;
ret = gst_pad_pull_range (avi->sinkpad, offset, size, &buf);
if (ret != GST_FLOW_OK)
goto pull_failed;
......
......@@ -2080,6 +2080,7 @@ gst_flv_demux_pull_tag (GstPad * pad, GstFlvDemux * demux)
demux->offset += FLV_TAG_TYPE_SIZE;
/* Pull the whole tag */
buffer = NULL;
if (G_UNLIKELY ((ret = gst_flv_demux_pull_range (demux, pad, demux->offset,
demux->tag_size, &buffer)) != GST_FLOW_OK))
goto beach;
......@@ -2241,12 +2242,14 @@ gst_flv_demux_create_index (GstFlvDemux * demux, gint64 pos, GstClockTime ts)
old_offset = demux->offset;
demux->offset = pos;
buffer = NULL;
while ((ret = gst_flv_demux_pull_range (demux, demux->sinkpad, demux->offset,
12, &buffer)) == GST_FLOW_OK) {
tag_time =
gst_flv_demux_parse_tag_timestamp (demux, TRUE, buffer, &tag_size);
gst_buffer_unref (buffer);
buffer = NULL;
if (G_UNLIKELY (tag_time == GST_CLOCK_TIME_NONE || tag_time > ts))
goto exit;
......
......@@ -2682,7 +2682,7 @@ gst_qtdemux_loop_state_header (GstQTDemux * qtdemux)
}
case FOURCC_moov:
{
GstBuffer *moov;
GstBuffer *moov = NULL;
if (qtdemux->got_moov) {
GST_DEBUG_OBJECT (qtdemux, "Skipping moov atom as we have one already");
......@@ -2745,7 +2745,7 @@ gst_qtdemux_loop_state_header (GstQTDemux * qtdemux)
}
case FOURCC_ftyp:
{
GstBuffer *ftyp;
GstBuffer *ftyp = NULL;
/* extract major brand; might come in handy for ISO vs QT issues */
ret = gst_qtdemux_pull_atom (qtdemux, cur_offset, length, &ftyp);
......@@ -2760,7 +2760,7 @@ gst_qtdemux_loop_state_header (GstQTDemux * qtdemux)
}
case FOURCC_uuid:
{
GstBuffer *uuid;
GstBuffer *uuid = NULL;
/* uuid are extension atoms */
ret = gst_qtdemux_pull_atom (qtdemux, cur_offset, length, &uuid);
......@@ -2775,7 +2775,7 @@ gst_qtdemux_loop_state_header (GstQTDemux * qtdemux)
}
default:
{
GstBuffer *unknown;
GstBuffer *unknown = NULL;
GST_LOG_OBJECT (qtdemux,
"unknown %08x '%" GST_FOURCC_FORMAT "' of size %" G_GUINT64_FORMAT
......@@ -5179,6 +5179,7 @@ qtdemux_find_atom (GstQTDemux * qtdemux, guint64 * offset,
while (TRUE) {
GstMapInfo map;
buf = NULL;
ret = gst_pad_pull_range (qtdemux->sinkpad, *offset, 16, &buf);
if (G_UNLIKELY (ret != GST_FLOW_OK))
goto locate_failed;
......
......@@ -1229,7 +1229,7 @@ gst_matroska_parse_search_cluster (GstMatroskaParse * parse, gint64 * pos)
gint64 orig_offset;
GstFlowReturn ret = GST_FLOW_OK;
const guint chunk = 64 * 1024;
GstBuffer *buf = NULL;
GstBuffer *buf;
GstMapInfo map;
gpointer data;
gsize size;
......@@ -1244,6 +1244,7 @@ gst_matroska_parse_search_cluster (GstMatroskaParse * parse, gint64 * pos)
GstByteReader reader;
gint cluster_pos;
buf = NULL;
ret = gst_pad_pull_range (parse->common.sinkpad, newpos, chunk, &buf);
if (ret != GST_FLOW_OK)
break;
......
......@@ -1285,6 +1285,7 @@ gst_wavparse_stream_headers (GstWavParse * wav)
} else {
GstMapInfo map;
buf = NULL;
if ((res =
gst_pad_pull_range (wav->sinkpad, wav->offset, 8,
&buf)) != GST_FLOW_OK)
......@@ -1365,6 +1366,7 @@ gst_wavparse_stream_headers (GstWavParse * wav)
gst_adapter_flush (wav->adapter, GST_ROUND_UP_2 (size));
} else {
gst_buffer_unref (buf);
buf = NULL;
if ((res =
gst_pad_pull_range (wav->sinkpad, wav->offset + 8,
data_size, &buf)) != GST_FLOW_OK)
......@@ -1411,6 +1413,7 @@ gst_wavparse_stream_headers (GstWavParse * wav)
} else {
GstMapInfo map;
gst_buffer_unref (buf);
buf = NULL;
if ((res =
gst_pad_pull_range (wav->sinkpad, wav->offset + 8,
size, &buf)) != GST_FLOW_OK)
......@@ -1450,6 +1453,7 @@ gst_wavparse_stream_headers (GstWavParse * wav)
gst_adapter_unmap (wav->adapter);
} else {
gst_buffer_unref (buf);
buf = NULL;
if ((res =
gst_pad_pull_range (wav->sinkpad, wav->offset, 12,
&buf)) != GST_FLOW_OK)
......@@ -1477,6 +1481,7 @@ gst_wavparse_stream_headers (GstWavParse * wav)
} else {
wav->offset += 12;
gst_buffer_unref (buf);
buf = NULL;
if (data_size > 0) {
if ((res =
gst_pad_pull_range (wav->sinkpad, wav->offset,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment