gstvalue: reset errno before g_ascii_strtoull call
authorHyunjun Ko <zzoon.ko@samsung.com>
Sat, 11 Apr 2015 11:44:02 +0000 (20:44 +0900)
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Mon, 13 Apr 2015 10:39:59 +0000 (11:39 +0100)
"errno" already has meaningless value before g_ascii_strtoull call.
This causes invalid error check without reset.

https://bugzilla.gnome.org/show_bug.cgi?id=747690

gst/gstvalue.c

index 21771eb..123e51e 100644 (file)
@@ -5839,6 +5839,7 @@ gst_value_deserialize_bitmask (GValue * dest, const gchar * s)
   if (G_UNLIKELY (dest == NULL || !GST_VALUE_HOLDS_BITMASK (dest)))
     return FALSE;
 
+  errno = 0;
   val = g_ascii_strtoull (s, &endptr, 16);
   if (val == G_MAXUINT64 && (errno == ERANGE || errno == EINVAL))
     return FALSE;