summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2016-02-23 18:27:47 +0200
committerSebastian Dröge <sebastian@centricular.com>2016-02-23 18:27:47 +0200
commit49f46319097fd723909a6eeb749ead9fbd497806 (patch)
treeebf6477aef1b7e3113fde666c8a3880053eed4ad
parent9b2e1f9f360756e65cf137d3ef0f119bb73508c6 (diff)
downloadgstreamer-plugins-good-49f46319097fd723909a6eeb749ead9fbd497806.tar.gz
gst: Handle gst_pad_get_current_caps() returning NULL gracefully
-rw-r--r--ext/dv/gstdvdec.c3
-rw-r--r--ext/gdk_pixbuf/gstgdkpixbufdec.c2
-rw-r--r--gst/deinterlace/gstdeinterlace.c5
-rw-r--r--gst/smpte/gstsmpte.c6
4 files changed, 12 insertions, 4 deletions
diff --git a/ext/dv/gstdvdec.c b/ext/dv/gstdvdec.c
index 4fd01c9a2..89911d70c 100644
--- a/ext/dv/gstdvdec.c
+++ b/ext/dv/gstdvdec.c
@@ -479,6 +479,9 @@ gst_dvdec_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
GstCaps *caps;
caps = gst_pad_get_current_caps (dvdec->srcpad);
+ if (!caps)
+ goto not_negotiated;
+
gst_dvdec_negotiate_pool (dvdec, caps, &dvdec->vinfo);
gst_caps_unref (caps);
}
diff --git a/ext/gdk_pixbuf/gstgdkpixbufdec.c b/ext/gdk_pixbuf/gstgdkpixbufdec.c
index 36cfbc027..589e74fa3 100644
--- a/ext/gdk_pixbuf/gstgdkpixbufdec.c
+++ b/ext/gdk_pixbuf/gstgdkpixbufdec.c
@@ -228,6 +228,8 @@ gst_gdk_pixbuf_dec_setup_pool (GstGdkPixbufDec * filter, GstVideoInfo * info)
guint size, min, max;
target = gst_pad_get_current_caps (filter->srcpad);
+ if (!target)
+ return FALSE;
/* try to get a bufferpool now */
/* find a pool for the negotiated caps now */
diff --git a/gst/deinterlace/gstdeinterlace.c b/gst/deinterlace/gstdeinterlace.c
index 6d2e68c11..8bf824780 100644
--- a/gst/deinterlace/gstdeinterlace.c
+++ b/gst/deinterlace/gstdeinterlace.c
@@ -1546,8 +1546,9 @@ restart:
/* setcaps on sink and src pads */
sinkcaps = gst_pad_get_current_caps (self->sinkpad);
- if (!gst_deinterlace_setcaps (self, self->sinkpad, sinkcaps)) {
- gst_caps_unref (sinkcaps);
+ if (!sinkcaps || !gst_deinterlace_setcaps (self, self->sinkpad, sinkcaps)) {
+ if (sinkcaps)
+ gst_caps_unref (sinkcaps);
return GST_FLOW_NOT_NEGOTIATED;
}
diff --git a/gst/smpte/gstsmpte.c b/gst/smpte/gstsmpte.c
index 294d809ea..33d428427 100644
--- a/gst/smpte/gstsmpte.c
+++ b/gst/smpte/gstsmpte.c
@@ -559,8 +559,10 @@ input_formats_do_not_match:
GST_ELEMENT_ERROR (smpte, CORE, NEGOTIATION, (NULL),
("input formats don't match: %" GST_PTR_FORMAT " vs. %" GST_PTR_FORMAT,
caps1, caps2));
- gst_caps_unref (caps1);
- gst_caps_unref (caps2);
+ if (caps1)
+ gst_caps_unref (caps1);
+ if (caps2)
+ gst_caps_unref (caps2);
return GST_FLOW_ERROR;
}
}