From e5a37377ae29cfc6f3cef39be028fb2ef7fe3afa Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Thu, 3 Jun 2010 15:51:18 +0530 Subject: [PATCH] mpegtsdemux: Some checks to avoid asserts gst_mpeg_descriptor_find() expects the description field to be non-NULL. This fixes a couple of calls where the value being passed is not verified to be non-NULL first. https://bugzilla.gnome.org/show_bug.cgi?id=620456 --- gst/mpegdemux/gstmpegtsdemux.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gst/mpegdemux/gstmpegtsdemux.c b/gst/mpegdemux/gstmpegtsdemux.c index 1c747c3671..058507bbf0 100644 --- a/gst/mpegdemux/gstmpegtsdemux.c +++ b/gst/mpegdemux/gstmpegtsdemux.c @@ -744,13 +744,14 @@ gst_mpegts_demux_fill_stream (GstMpegTSStream * stream, guint8 id, template = klass->audio_template; name = g_strdup_printf ("audio_%04x", stream->PID); caps = gst_caps_new_simple ("audio/x-eac3", NULL); - } else if (gst_mpeg_descriptor_find (stream->ES_info, + } else if (stream->ES_info && gst_mpeg_descriptor_find (stream->ES_info, DESC_DVB_ENHANCED_AC3)) { template = klass->audio_template; name = g_strdup_printf ("audio_%04x", stream->PID); caps = gst_caps_new_simple ("audio/x-eac3", NULL); } else { - if (!gst_mpeg_descriptor_find (stream->ES_info, DESC_DVB_AC3)) { + if (!stream->ES_info || + !gst_mpeg_descriptor_find (stream->ES_info, DESC_DVB_AC3)) { GST_WARNING ("AC3 stream type found but no corresponding " "descriptor to differentiate between AC3 and EAC3. " "Assuming plain AC3.");