projects
/
platform
/
upstream
/
gstreamer.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
386562f
)
gstvalue: Gracefully handle NULL Gvalue
author
Edward Hervey
<edward@collabora.com>
Fri, 17 Feb 2012 23:07:56 +0000
(15:07 -0800)
committer
Edward Hervey
<edward@collabora.com>
Fri, 17 Feb 2012 23:11:38 +0000
(15:11 -0800)
Avoids unreferencing NULL pointer
gst/gstvalue.c
patch
|
blob
|
history
diff --git
a/gst/gstvalue.c
b/gst/gstvalue.c
index
966293a
..
1ffe441
100644
(file)
--- a/
gst/gstvalue.c
+++ b/
gst/gstvalue.c
@@
-299,6
+299,9
@@
gst_value_lcopy_list_or_array (const GValue * value, guint n_collect_values,
static gboolean
gst_value_list_or_array_get_basic_type (const GValue * value, GType * type)
{
+ if (G_UNLIKELY (value == NULL))
+ return FALSE;
+
if (GST_VALUE_HOLDS_LIST (value)) {
if (VALUE_LIST_SIZE (value) == 0)
return FALSE;
@@
-312,7
+315,9
@@
gst_value_list_or_array_get_basic_type (const GValue * value, GType * type)
return gst_value_list_or_array_get_basic_type (&g_array_index (array,
GValue, 0), type);
}
+
*type = G_VALUE_TYPE (value);
+
return TRUE;
}