mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-22 15:18:21 +00:00
gst/gstvalue.c: Handle NULL input and output pointers silently as a failed conversion, rather than g_warnings.
Original commit message from CVS: * gst/gstvalue.c: (gst_value_deserialize_fraction): Handle NULL input and output pointers silently as a failed conversion, rather than g_warnings.
This commit is contained in:
parent
803ecd5d58
commit
8bf748a28e
2 changed files with 14 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2006-05-26 Jan Schmidt <thaytan@mad.scientist.com>
|
||||||
|
|
||||||
|
* gst/gstvalue.c: (gst_value_deserialize_fraction):
|
||||||
|
Handle NULL input and output pointers silently as a failed conversion,
|
||||||
|
rather than g_warnings.
|
||||||
|
|
||||||
2006-05-25 Wim Taymans <wim@fluendo.com>
|
2006-05-25 Wim Taymans <wim@fluendo.com>
|
||||||
|
|
||||||
* libs/gst/net/gstnetclientclock.c: (gst_net_client_clock_start):
|
* libs/gst/net/gstnetclientclock.c: (gst_net_client_clock_start):
|
||||||
|
|
|
@ -3389,11 +3389,17 @@ gst_value_deserialize_fraction (GValue * dest, const gchar * s)
|
||||||
{
|
{
|
||||||
gint num, den;
|
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);
|
gst_value_set_fraction (dest, num, den);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
if (s && sscanf (s, "%d", &num) == 1) {
|
if (sscanf (s, "%d", &num) == 1) {
|
||||||
gst_value_set_fraction (dest, num, 1);
|
gst_value_set_fraction (dest, num, 1);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue