ext/vorbis/vorbisdec.c: Fix #327216 (null dereference in vorbisdec)

Original commit message from CVS:

* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query):
Fix #327216 (null dereference in vorbisdec)
This commit is contained in:
Thomas Vander Stichele 2006-01-16 15:31:14 +00:00
parent 2d15397f29
commit 325e713953
2 changed files with 11 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2006-01-16 Thomas Vander Stichele <thomas at apestaart dot org>
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query):
Fix #327216 (null dereference in vorbisdec)
2006-01-16 Tim-Philipp Müller <tim at centricular dot net> 2006-01-16 Tim-Philipp Müller <tim at centricular dot net>
* ext/theora/theoradec.c: (theora_handle_comment_packet): * ext/theora/theoradec.c: (theora_handle_comment_packet):

View file

@ -274,7 +274,7 @@ vorbis_dec_src_query (GstPad * pad, GstQuery * query)
{ {
gint64 granulepos; gint64 granulepos;
GstVorbisDec *dec; GstVorbisDec *dec;
gboolean res; gboolean res = FALSE;
dec = GST_VORBIS_DEC (GST_PAD_PARENT (pad)); dec = GST_VORBIS_DEC (GST_PAD_PARENT (pad));
@ -307,6 +307,11 @@ vorbis_dec_src_query (GstPad * pad, GstQuery * query)
case GST_QUERY_DURATION: case GST_QUERY_DURATION:
{ {
/* query peer for total length */ /* query peer for total length */
if (!gst_pad_is_linked (dec->sinkpad)) {
GST_WARNING_OBJECT (dec, "sink pad %" GST_PTR_FORMAT " is not linked",
dec->sinkpad);
goto error;
}
if (!(res = gst_pad_query (GST_PAD_PEER (dec->sinkpad), query))) if (!(res = gst_pad_query (GST_PAD_PEER (dec->sinkpad), query)))
goto error; goto error;
break; break;