don't pass random pointers to pull_range

This commit is contained in:
Wim Taymans 2012-03-16 21:47:39 +01:00
parent ed82d408b1
commit bc38bc27b7
11 changed files with 29 additions and 10 deletions

View file

@ -582,7 +582,7 @@ gst_timidity_loop (GstPad * sinkpad)
}
if (timidity->mididata_offset < timidity->mididata_size) {
GstBuffer *buffer;
GstBuffer *buffer = NULL;
gint64 size;
GST_DEBUG_OBJECT (timidity, "loading song");

View file

@ -809,7 +809,7 @@ gst_wildmidi_loop (GstPad * sinkpad)
switch (wildmidi->state) {
case GST_WILDMIDI_STATE_LOAD:
{
GstBuffer *buffer;
GstBuffer *buffer = NULL;
GST_DEBUG_OBJECT (wildmidi, "loading song");

View file

@ -927,6 +927,7 @@ gst_signal_processor_do_pulls (GstSignalProcessor * self, guint nframes)
continue;
}
buf = NULL;
ret =
gst_pad_pull_range (GST_PAD (spad), -1, nframes * sizeof (gfloat),
&buf);

View file

@ -226,12 +226,13 @@ gst_asf_parse_pull_packets (GstAsfParse * asfparse)
GstFlowReturn ret;
while (asfparse->asfinfo->broadcast ||
asfparse->parsed_packets < asfparse->asfinfo->packets_count) {
GstBuffer *packet = NULL;
GstBuffer *packet;
GST_DEBUG_OBJECT (asfparse, "Parsing packet %" G_GUINT64_FORMAT,
asfparse->parsed_packets);
/* get the packet */
packet = NULL;
ret = gst_pad_pull_range (asfparse->sinkpad, asfparse->offset,
asfparse->asfinfo->packet_size, &packet);
if (ret != GST_FLOW_OK)
@ -250,11 +251,12 @@ gst_asf_parse_pull_packets (GstAsfParse * asfparse)
static GstFlowReturn
gst_asf_parse_pull_indexes (GstAsfParse * asfparse)
{
GstBuffer *guid_and_size = NULL;
GstBuffer *buf = NULL;
GstBuffer *guid_and_size;
GstBuffer *buf;
guint64 obj_size;
GstFlowReturn ret = GST_FLOW_OK;
while (1) {
guid_and_size = NULL;
ret = gst_pad_pull_range (asfparse->sinkpad, asfparse->offset,
ASF_GUID_OBJSIZE_SIZE, &guid_and_size);
if (ret != GST_FLOW_OK)
@ -271,6 +273,7 @@ gst_asf_parse_pull_indexes (GstAsfParse * asfparse)
asfparse->offset += ASF_GUID_OBJSIZE_SIZE;
/* pull the rest of the object */
buf = NULL;
ret = gst_pad_pull_range (asfparse->sinkpad, asfparse->offset, obj_size,
&buf);
if (ret != GST_FLOW_OK) {

View file

@ -292,6 +292,7 @@ gst_cdxa_parse_loop (GstPad * sinkpad)
req = 8 + GST_CDXA_SECTOR_SIZE; /* riff chunk header = 8 bytes */
buf = NULL;
flow_ret = gst_pad_pull_range (cdxa->sinkpad, cdxa->offset, req, &buf);
if (flow_ret != GST_FLOW_OK) {
@ -330,6 +331,7 @@ gst_cdxa_parse_loop (GstPad * sinkpad)
GST_DEBUG_OBJECT (cdxa, "pulling buffer at offset 0x%" G_GINT64_MODIFIER "x",
cdxa->offset);
buf = NULL;
flow_ret = gst_pad_pull_range (cdxa->sinkpad, cdxa->offset,
GST_CDXA_SECTOR_SIZE, &buf);

View file

@ -2472,7 +2472,7 @@ gst_flups_demux_scan_forward_ts (GstFluPSDemux * demux, guint64 * pos,
SCAN_MODE mode, guint64 * rts, gint limit)
{
GstFlowReturn ret = GST_FLOW_OK;
GstBuffer *buffer = NULL;
GstBuffer *buffer;
guint64 offset = *pos;
gboolean found = FALSE;
guint64 ts = 0;
@ -2492,6 +2492,7 @@ gst_flups_demux_scan_forward_ts (GstFluPSDemux * demux, guint64 * pos,
to_read = demux->sink_segment.stop - offset;
/* read some data */
buffer = NULL;
ret = gst_pad_pull_range (demux->sinkpad, offset, to_read, &buffer);
if (G_UNLIKELY (ret != GST_FLOW_OK))
return FALSE;
@ -2531,7 +2532,7 @@ gst_flups_demux_scan_backward_ts (GstFluPSDemux * demux, guint64 * pos,
SCAN_MODE mode, guint64 * rts, gint limit)
{
GstFlowReturn ret = GST_FLOW_OK;
GstBuffer *buffer = NULL;
GstBuffer *buffer;
guint64 offset = *pos;
gboolean found = FALSE;
guint64 ts = 0;
@ -2555,6 +2556,7 @@ gst_flups_demux_scan_backward_ts (GstFluPSDemux * demux, guint64 * pos,
offset = 0;
}
/* read some data */
buffer = NULL;
ret = gst_pad_pull_range (demux->sinkpad, offset, to_read, &buffer);
if (G_UNLIKELY (ret != GST_FLOW_OK))
return FALSE;
@ -2712,7 +2714,8 @@ gst_flups_demux_pull_block (GstPad * pad, GstFluPSDemux * demux,
guint64 offset, guint size)
{
GstFlowReturn ret = GST_FLOW_OK;
GstBuffer *buffer;
GstBuffer *buffer = NULL;
ret = gst_pad_pull_range (pad, offset, size, &buffer);
if (G_UNLIKELY (ret != GST_FLOW_OK)) {
GST_DEBUG_OBJECT (demux, "pull range at %" G_GUINT64_FORMAT

View file

@ -1373,6 +1373,7 @@ mpegts_base_scan (MpegTSBase * base)
GST_DEBUG ("Grabbing %d => %d", i * 50 * MPEGTS_MAX_PACKETSIZE,
50 * MPEGTS_MAX_PACKETSIZE);
buf = NULL;
ret = gst_pad_pull_range (base->sinkpad, i * 50 * MPEGTS_MAX_PACKETSIZE,
50 * MPEGTS_MAX_PACKETSIZE, &buf);
if (G_UNLIKELY (ret != GST_FLOW_OK))
@ -1433,7 +1434,7 @@ mpegts_base_loop (MpegTSBase * base)
break;
case BASE_MODE_STREAMING:
{
GstBuffer *buf;
GstBuffer *buf = NULL;
GST_DEBUG ("Pulling data from %" G_GUINT64_FORMAT, base->seek_offset);

View file

@ -523,6 +523,7 @@ gst_ts_demux_perform_auxiliary_seek (MpegTSBase * base, GstClockTime seektime,
offset -= 4;
while (!done && scan_offset <= length) {
buf = NULL;
res =
gst_pad_pull_range (base->sinkpad, offset + scan_offset,
50 * MPEGTS_MAX_PACKETSIZE, &buf);
@ -1497,6 +1498,7 @@ find_pcr_packet (MpegTSBase * base, guint64 offset, gint64 length,
offset -= 4;
while (!done && scan_offset < length) {
buf = NULL;
ret =
gst_pad_pull_range (base->sinkpad, offset + scan_offset,
50 * MPEGTS_MAX_PACKETSIZE, &buf);
@ -1604,6 +1606,7 @@ find_timestamps (MpegTSBase * base, guint64 initoff, guint64 * offset)
/* Start scanning from now PAT offset */
while (!done) {
buf = NULL;
ret = gst_pad_pull_range (base->sinkpad, i * 50 * MPEGTS_MAX_PACKETSIZE,
50 * MPEGTS_MAX_PACKETSIZE, &buf);
@ -1654,6 +1657,7 @@ find_timestamps (MpegTSBase * base, guint64 initoff, guint64 * offset)
" and the end:%" G_GINT64_FORMAT, scan_offset, total_bytes);
while ((!done) && (scan_offset < total_bytes)) {
buf = NULL;
ret = gst_pad_pull_range (base->sinkpad, scan_offset,
50 * MPEGTS_MAX_PACKETSIZE, &buf);
@ -1742,6 +1746,7 @@ process_pcr (MpegTSBase * base, guint64 initoff, TSPcrOffset * pcroffset,
GstMapInfo map;
gsize size;
buf = NULL;
ret = gst_pad_pull_range (base->sinkpad,
initoff + i * 500 * base->packetsize, 500 * base->packetsize, &buf);

View file

@ -2032,6 +2032,7 @@ gst_mxf_demux_pull_random_index_pack (GstMXFDemux * demux)
g_assert (filesize > 4);
buffer = NULL;
if ((ret =
gst_mxf_demux_pull_range (demux, filesize - 4, 4,
&buffer)) != GST_FLOW_OK) {
@ -2051,6 +2052,7 @@ gst_mxf_demux_pull_random_index_pack (GstMXFDemux * demux)
return;
}
buffer = NULL;
if ((ret =
gst_mxf_demux_pull_range (demux, filesize - pack_size, 16,
&buffer)) != GST_FLOW_OK) {
@ -2692,7 +2694,7 @@ gst_mxf_demux_loop (GstPad * pad)
/* Skip run-in, which is at most 64K and is finished
* by a header partition pack */
while (demux->offset < 64 * 1024) {
GstBuffer *buffer;
GstBuffer *buffer = NULL;
if ((ret =
gst_mxf_demux_pull_range (demux, demux->offset, 16,

View file

@ -544,6 +544,7 @@ gst_nuv_demux_stream_mpeg_data (GstNuvDemux * nuv)
GstFlowReturn ret = GST_FLOW_OK;
/* ffmpeg extra data */
nuv->mpeg_buffer = NULL;
ret =
gst_nuv_demux_read_bytes (nuv, nuv->mpeg_data_size, TRUE,
&nuv->mpeg_buffer);

View file

@ -366,6 +366,7 @@ gst_raw_parse_loop (GstElement * element)
rp->offset -= size;
}
buffer = NULL;
ret = gst_pad_pull_range (rp->sinkpad, rp->offset, size, &buffer);
if (ret != GST_FLOW_OK) {