Fix bug in _gst_caps_value_copy() that could cause GValue corruption
authorDavid Schleef <ds@schleef.org>
Wed, 24 Dec 2003 00:02:17 +0000 (00:02 +0000)
committerDavid Schleef <ds@schleef.org>
Wed, 24 Dec 2003 00:02:17 +0000 (00:02 +0000)
Original commit message from CVS:
Fix bug in _gst_caps_value_copy() that could cause GValue corruption

gst/gstcaps.c

index 66e0eb9..5d29673 100644 (file)
@@ -698,6 +698,8 @@ static void _gst_caps_value_copy (const GValue *src, GValue *dest)
 {
   if (dest->data[0].v_pointer) {
     gst_caps_free (dest->data[0].v_pointer);
+  }
+  if (src->data[0].v_pointer) {
     dest->data[0].v_pointer = gst_caps_copy (src->data[0].v_pointer);
   } else {
     dest->data[0].v_pointer = NULL;