All pastes #364742 Raw Edit

Anonymous

public text v1 · immutable
#364742 ·published 2007-02-20 11:24 UTC
rendered paste body
Index: backends/gstreamer/rb-encoder-gst.c
===================================================================
--- backends/gstreamer/rb-encoder-gst.c	(revision 4830)
+++ backends/gstreamer/rb-encoder-gst.c	(working copy)
@@ -652,15 +652,21 @@ encoder_match_mime (RBEncoderGst *rbenco
 	GstCaps *element_caps;
 	GstCaps *desired_caps;
 	GstCaps *intersect_caps;
-	gboolean match;
+	gboolean match = FALSE;
 	char *tmp;
 
 	srcpad = gst_element_get_pad (encoder, "src");
 	element_caps = gst_pad_get_caps (srcpad);
 
 	desired_caps = g_hash_table_lookup (RB_ENCODER_GST_GET_CLASS (rbencoder)->mime_caps_table, mime_type);
-	if (desired_caps == NULL)
+	if (desired_caps == NULL) {
 		desired_caps = gst_caps_new_simple (mime_type, NULL);
+	}
+
+	if (desired_caps == NULL) {
+		g_warnings ("couldn't create any desired caps for mimetype: %s", mime_type);
+		goto end;
+	}
 
 	intersect_caps = gst_caps_intersect (desired_caps, element_caps);
 	match = !gst_caps_is_empty (intersect_caps);
@@ -679,6 +685,8 @@ encoder_match_mime (RBEncoderGst *rbenco
 
 	gst_caps_unref (intersect_caps);
 	gst_caps_unref (desired_caps);
+
+end:
 	gst_caps_unref (element_caps);
 	gst_object_unref (GST_OBJECT (srcpad));