[librsvg] css: Fix parsing of #rrggbb values



commit d2f29eb4fb43bb1fbc9ff7a399880dfa5b71a84d
Author: Christian Persch <chpe gnome org>
Date:   Fri Oct 11 20:45:56 2013 +0200

    css: Fix parsing of #rrggbb values
    
    Fallout from commit 30991cd1299da9b81f2f3c176a38b10f992b2aaf.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=709931

 rsvg-css.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/rsvg-css.c b/rsvg-css.c
index f098d34..d61cca2 100644
--- a/rsvg-css.c
+++ b/rsvg-css.c
@@ -338,6 +338,8 @@ rsvg_css_parse_color (const char *str, gboolean * inherit)
             val = ((val & 0xf00) << 8) | ((val & 0x0f0) << 4) | (val & 0x00f);
             val |= val << 4;
         }
+
+        val |= 0xff000000; /* opaque */
     }
     else if (g_str_has_prefix (str, "rgb")) {
         gint r, g, b, a;
@@ -388,9 +390,9 @@ rsvg_css_parse_color (const char *str, gboolean * inherit)
         if (cr_rgb_set_from_name (&rgb, (const guchar *) str) == CR_OK) {
             val = PACK_RGB (rgb.red, rgb.green, rgb.blue);
         } else {
-            /* default to black on failed lookup */
+            /* default to opaque black on failed lookup */
             UNSETINHERIT ();
-            val = 0;
+            val = PACK_RGB (0, 0, 0);
         }
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]