diff options
author | Thibault Saunier <tsaunier@igalia.com> | 2019-03-20 21:38:04 -0300 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2019-05-02 11:00:56 +0100 |
commit | e1e2ff9884610ebbe33d72f5d33028838c34a400 (patch) | |
tree | 210ae7705308b54d03237416d90d8e91091ca3ac | |
parent | a2dab9727cd225f79ef0d385bcf0cbda25618566 (diff) | |
download | gstreamer-plugins-bad-e1e2ff9884610ebbe33d72f5d33028838c34a400.tar.gz |
mxfdemux: Avoid possible NULL caps 'dereferencing'
-rw-r--r-- | gst/mxf/mxfdemux.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gst/mxf/mxfdemux.c b/gst/mxf/mxfdemux.c index eefdf8173..f6e5ac048 100644 --- a/gst/mxf/mxfdemux.c +++ b/gst/mxf/mxfdemux.c @@ -1658,10 +1658,12 @@ gst_mxf_demux_pad_set_component (GstMXFDemux * demux, GstMXFDemuxPad * pad, pad->current_essence_track_position = pad->current_component_start; pad_caps = gst_pad_get_current_caps (GST_PAD_CAST (pad)); - if (!gst_caps_is_equal (pad_caps, pad->current_essence_track->caps)) { + if (!pad_caps + || !gst_caps_is_equal (pad_caps, pad->current_essence_track->caps)) { gst_pad_set_caps (GST_PAD_CAST (pad), pad->current_essence_track->caps); } - gst_caps_unref (pad_caps); + if (pad_caps) + gst_caps_unref (pad_caps); if (update) { if (pad->tags) { |