summaryrefslogtreecommitdiff
path: root/ext/x264/gstx264enc.c
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.com>2013-11-29 15:49:29 +0000
committerSebastian Dröge <sebastian@centricular.com>2013-12-13 14:30:24 +0100
commit9e9cf013493d4a3c01fe35a1f7e993022a32e3f7 (patch)
treeafd4ecbc01bb9ea677ee7989677c37bbbc2b438d /ext/x264/gstx264enc.c
parent61dd410528f656415bb057ab375e6892f96e7a21 (diff)
x264enc: fix crash on NULL caps when negotiation happens without a downstream peer
gst-launch-1.0 videotestsrc ! x264enc
Diffstat (limited to 'ext/x264/gstx264enc.c')
-rw-r--r--ext/x264/gstx264enc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/x264/gstx264enc.c b/ext/x264/gstx264enc.c
index 5fc5e121..8ec88b3d 100644
--- a/ext/x264/gstx264enc.c
+++ b/ext/x264/gstx264enc.c
@@ -1552,6 +1552,10 @@ gst_x264_enc_set_profile_and_level (GstX264Enc * encoder, GstCaps * caps)
profile = gst_structure_get_string (s, "profile");
allowed_caps = gst_pad_get_allowed_caps (GST_VIDEO_ENCODER_SRC_PAD (encoder));
+
+ if (allowed_caps == NULL)
+ goto no_peer;
+
if (!gst_caps_can_intersect (allowed_caps, caps)) {
allowed_caps = gst_caps_make_writable (allowed_caps);
allowed_caps = gst_caps_truncate (allowed_caps);
@@ -1581,6 +1585,8 @@ gst_x264_enc_set_profile_and_level (GstX264Enc * encoder, GstCaps * caps)
}
gst_caps_unref (allowed_caps);
+no_peer:
+
return TRUE;
}