From ce2070c09210020a10f2762f7f616432dec519a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 28 Feb 2017 15:20:31 +0200 Subject: [PATCH] qtdemux: Protect against NULL pointer dereference for streams without caps CID 1363332 --- gst/isomp4/qtdemux.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c index 6fe334372d..392e0368ed 100644 --- a/gst/isomp4/qtdemux.c +++ b/gst/isomp4/qtdemux.c @@ -7814,11 +7814,16 @@ gst_qtdemux_configure_stream (GstQTDemux * qtdemux, QtDemuxStream * stream) prev_caps = gst_pad_get_current_caps (stream->pad); - if (!prev_caps || !gst_caps_is_equal_fixed (prev_caps, stream->caps)) { - GST_DEBUG_OBJECT (qtdemux, "setting caps %" GST_PTR_FORMAT, stream->caps); - gst_pad_set_caps (stream->pad, stream->caps); + if (stream->caps) { + if (!prev_caps || !gst_caps_is_equal_fixed (prev_caps, stream->caps)) { + GST_DEBUG_OBJECT (qtdemux, "setting caps %" GST_PTR_FORMAT, + stream->caps); + gst_pad_set_caps (stream->pad, stream->caps); + } else { + GST_DEBUG_OBJECT (qtdemux, "ignore duplicated caps"); + } } else { - GST_DEBUG_OBJECT (qtdemux, "ignore duplicated caps"); + GST_WARNING_OBJECT (qtdemux, "stream without caps"); } if (prev_caps)