2008-10-17 Emmanuele Bassi <ebassi@linux.intel.com>
* clutter/clutter-color.c (clutter_color_parse): Add checks for the arguments, to avoid trying to parse NULL strings.
This commit is contained in:
parent
6d4667cb61
commit
9cf5386bb1
@ -1,3 +1,8 @@
|
|||||||
|
2008-10-17 Emmanuele Bassi <ebassi@linux.intel.com>
|
||||||
|
|
||||||
|
* clutter/clutter-color.c (clutter_color_parse): Add checks
|
||||||
|
for the arguments, to avoid trying to parse NULL strings.
|
||||||
|
|
||||||
2008-10-16 Emmanuele Bassi <ebassi@linux.intel.com>
|
2008-10-16 Emmanuele Bassi <ebassi@linux.intel.com>
|
||||||
|
|
||||||
* clutter/clutter-container.[ch]: Add checks to the Container
|
* clutter/clutter-container.[ch]: Add checks to the Container
|
||||||
|
@ -482,6 +482,9 @@ clutter_color_parse (const gchar *color,
|
|||||||
{
|
{
|
||||||
PangoColor pango_color;
|
PangoColor pango_color;
|
||||||
|
|
||||||
|
g_return_val_if_fail (color != NULL, FALSE);
|
||||||
|
g_return_val_if_fail (dest != NULL, FALSE);
|
||||||
|
|
||||||
/* parse ourselves to get alpha */
|
/* parse ourselves to get alpha */
|
||||||
if (color[0] == '#')
|
if (color[0] == '#')
|
||||||
{
|
{
|
||||||
@ -491,9 +494,9 @@ clutter_color_parse (const gchar *color,
|
|||||||
{
|
{
|
||||||
if (strlen (color) == 9)
|
if (strlen (color) == 9)
|
||||||
{
|
{
|
||||||
dest->red = result >> 24 & 0xff;
|
dest->red = (result >> 24) & 0xff;
|
||||||
dest->green = (result >> 16) & 0xff;
|
dest->green = (result >> 16) & 0xff;
|
||||||
dest->blue = (result >> 8) & 0xff;
|
dest->blue = (result >> 8) & 0xff;
|
||||||
dest->alpha = result & 0xff;
|
dest->alpha = result & 0xff;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -501,7 +504,7 @@ clutter_color_parse (const gchar *color,
|
|||||||
else if (strlen (color) == 7)
|
else if (strlen (color) == 7)
|
||||||
{
|
{
|
||||||
dest->red = (result >> 16) & 0xff;
|
dest->red = (result >> 16) & 0xff;
|
||||||
dest->green = (result >> 8) & 0xff;
|
dest->green = (result >> 8) & 0xff;
|
||||||
dest->blue = result & 0xff;
|
dest->blue = result & 0xff;
|
||||||
dest->alpha = 0xff;
|
dest->alpha = 0xff;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user