summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: de6f88f)
raw | patch | inline | side by side (parent: de6f88f)
author | Stefan Kost <ensonic@users.sourceforge.net> | |
Mon, 17 Nov 2008 21:25:39 +0000 (21:25 +0000) | ||
committer | Stefan Kost <ensonic@users.sourceforge.net> | |
Mon, 17 Nov 2008 21:25:39 +0000 (21:25 +0000) |
Original commit message from CVS:
* gst/gstvalue.c:
Don't crash if either of the string GValues is empty.
* gst/gstvalue.c:
Don't crash if either of the string GValues is empty.
ChangeLog | patch | blob | history | |
gst/gstvalue.c | patch | blob | history |
diff --git a/ChangeLog b/ChangeLog
index 6c4bd89f399a91cc9656c3b7c1f88b3ce61d3ae2..d479772e804b0d7bc3511676056068871b2b52fb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
+2008-11-17 Stefan Kost <ensonic@users.sf.net>
+
+ * gst/gstvalue.c:
+ Don't crash if either of the string GValues is empty.
+
2008-11-17 Andy Wingo <wingo@pobox.com>
* tools/gst-inspect.c (print_all_uri_handlers): New function,
diff --git a/gst/gstvalue.c b/gst/gstvalue.c
index 66b27463eebe467f9351f7e75e0525f2e2ce9bf9..0e4322de86ae4f8bfe13efa4df93870a0decc102 100644 (file)
--- a/gst/gstvalue.c
+++ b/gst/gstvalue.c
static gint
gst_value_compare_string (const GValue * value1, const GValue * value2)
{
- int x = strcmp (value1->data[0].v_pointer, value2->data[0].v_pointer);
+ if (!value1->data[0].v_pointer || !value2->data[0].v_pointer) {
+ return GST_VALUE_UNORDERED;
+ } else {
+ int x = strcmp (value1->data[0].v_pointer, value2->data[0].v_pointer);
- if (x < 0)
- return GST_VALUE_LESS_THAN;
- if (x > 0)
- return GST_VALUE_GREATER_THAN;
- return GST_VALUE_EQUAL;
+ if (x < 0)
+ return GST_VALUE_LESS_THAN;
+ if (x > 0)
+ return GST_VALUE_GREATER_THAN;
+ return GST_VALUE_EQUAL;
+ }
}
/* keep in sync with gststructure.c */