gst/gstpad.c: Don't crash when trying to fixate and empty list.

Original commit message from CVS:
* gst/gstpad.c: (fixate_value):
Don't crash when trying to fixate and empty list.
Fixes #506643.
This commit is contained in:
Wim Taymans 2008-01-04 18:39:15 +00:00
parent 2ef7296544
commit 8951071467
2 changed files with 11 additions and 0 deletions

View file

@ -1,3 +1,9 @@
2008-01-04 Wim Taymans <wim.taymans@collabora.co.uk>
* gst/gstpad.c: (fixate_value):
Don't crash when trying to fixate and empty list.
Fixes #506643.
2008-01-03 Sebastian Dröge <slomo@circular-chaos.org>
* docs/faq/gst-uninstalled:

View file

@ -2120,7 +2120,12 @@ fixate_value (GValue * dest, const GValue * src)
} else if (G_VALUE_TYPE (src) == GST_TYPE_LIST) {
GValue temp = { 0 };
/* list could be empty */
if (gst_value_list_get_size (src) <= 0)
return FALSE;
gst_value_init_and_copy (&temp, gst_value_list_get_value (src, 0));
if (!fixate_value (dest, &temp))
gst_value_init_and_copy (dest, &temp);
g_value_unset (&temp);