ext/ogg/gstoggdemux.c: Check for non-NULL before accessing member (end-of-chain).

Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (get_relative):
Check for non-NULL before accessing member (end-of-chain).
This commit is contained in:
Ronald S. Bultje 2004-12-09 15:57:39 +00:00
parent c0d024e29a
commit c947ae7328
2 changed files with 16 additions and 6 deletions

View file

@ -1,3 +1,8 @@
2004-12-09 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* ext/ogg/gstoggdemux.c: (get_relative):
Check for non-NULL before accessing member (end-of-chain).
2004-12-09 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* ext/cdparanoia/gstcdparanoia.c: (cdparanoia_class_init),

View file

@ -417,7 +417,7 @@ get_relative (GstOggDemux * ogg, GstOggPad * cur, gint64 granpos, GstFormat out)
/* get base for this chain */
FOR_PAD_IN_CURRENT_CHAIN (ogg, pad,
if (pad->start != -1 &&
if (pad->start != -1 && pad->pad &&
GST_PAD_PEER (pad->pad) &&
gst_pad_convert (GST_PAD_PEER (pad->pad),
GST_FORMAT_DEFAULT, pad->start,
@ -614,10 +614,12 @@ gst_ogg_demux_src_event (GstPad * pad, GstEvent * event)
GST_OGG_SET_STATE (ogg, GST_OGG_STATE_SEEK);
FOR_PAD_IN_CURRENT_CHAIN (ogg, pad,
pad->flags |= GST_OGG_PAD_NEEDS_DISCONT;);
pad->flags |= GST_OGG_PAD_NEEDS_DISCONT;
);
if (GST_EVENT_SEEK_FLAGS (event) & GST_SEEK_FLAG_FLUSH) {
FOR_PAD_IN_CURRENT_CHAIN (ogg, pad,
pad->flags |= GST_OGG_PAD_NEEDS_FLUSH;);
pad->flags |= GST_OGG_PAD_NEEDS_FLUSH;
);
}
GST_DEBUG_OBJECT (ogg,
"initiating seeking to format %d, offset %" G_GUINT64_FORMAT, format,
@ -692,7 +694,8 @@ gst_ogg_demux_handle_event (GstPad * pad, GstEvent * event)
gst_event_unref (event);
GST_FLAG_UNSET (ogg, GST_OGG_FLAG_WAIT_FOR_DISCONT);
FOR_PAD_IN_CURRENT_CHAIN (ogg, pad,
pad->flags |= GST_OGG_PAD_NEEDS_DISCONT;);
pad->flags |= GST_OGG_PAD_NEEDS_DISCONT;
);
break;
default:
gst_pad_event_default (pad, event);
@ -978,7 +981,8 @@ _find_chain_get_unknown_part (GstOggDemux * ogg, gint64 * start, gint64 * end)
*end = G_MAXINT64;
g_assert (ogg->current_chain >= 0);
FOR_PAD_IN_CURRENT_CHAIN (ogg, pad, *start = MAX (*start, pad->end_offset););
FOR_PAD_IN_CURRENT_CHAIN (ogg, pad, *start = MAX (*start, pad->end_offset);
);
if (ogg->setup_state == SETUP_FIND_LAST_CHAIN) {
*end = gst_file_pad_get_length (ogg->sinkpad);
@ -1107,7 +1111,8 @@ _find_streams_check (GstOggDemux * ogg)
} else {
endpos = G_MAXINT64;
FOR_PAD_IN_CHAIN (ogg, pad, ogg->chains->len - 1,
endpos = MIN (endpos, pad->start_offset););
endpos = MIN (endpos, pad->start_offset);
);
}
if (!ogg->seek_skipped || gst_ogg_demux_position (ogg) >= endpos) {
/* have we found the endposition for all streams yet? */