Index: gst/gstvalue.c
===================================================================
RCS file: /cvs/gstreamer/gstreamer/gst/gstvalue.c,v
retrieving revision 1.117
diff -u -r1.117 gstvalue.c
--- gst/gstvalue.c	10 May 2006 15:38:53 -0000	1.117
+++ gst/gstvalue.c	13 May 2006 16:29:59 -0000
@@ -3389,11 +3389,17 @@
 {
   gint num, den;
 
-  if (s && sscanf (s, "%d/%d", &num, &den) == 2) {
+  if (G_UNLIKELY (s == NULL))
+    return FALSE;
+
+  if (G_UNLIKELY (dest == NULL || !GST_VALUE_HOLDS_FRACTION (dest)))
+    return FALSE;
+
+  if (sscanf (s, "%d/%d", &num, &den) == 2) {
     gst_value_set_fraction (dest, num, den);
     return TRUE;
   }
-  if (s && sscanf (s, "%d", &num) == 1) {
+  if (sscanf (s, "%d", &num) == 1) {
     gst_value_set_fraction (dest, num, 1);
     return TRUE;
   }
