gstvalue: reset errno before g_ascii_strtoull call

"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
This commit is contained in:
Hyunjun Ko 2015-04-11 20:44:02 +09:00 committed by Vincent Penquerc'h
parent 7d3d4503a1
commit e08c03ed07

View file

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