Evas textblock: Fixed a segfault with regular formats (ones without size explicitly...
authortasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 30 Jan 2011 10:42:56 +0000 (10:42 +0000)
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 30 Jan 2011 10:42:56 +0000 (10:42 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@56515 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/canvas/evas_object_textblock.c

index 8d15888..f69cfe5 100644 (file)
@@ -2213,12 +2213,18 @@ _layout_line_finalize(Ctxt *c, Evas_Object_Textblock_Format *fmt)
                   switch (fi->size)
                     {
                      case SIZE:
-                        p = strstr(s, " size=");
-                        p += 6;
-                        if (sscanf(p, "%ix%i", &w, &h) == 2)
+                        if (!strncmp(s, "item", 4))
                           {
-                             w = w * c->obj->cur.scale;
-                             h = h * c->obj->cur.scale;
+                             p = strstr(s, " size=");
+                             if (p)
+                               {
+                                  p += 6;
+                                  if (sscanf(p, "%ix%i", &w, &h) == 2)
+                                    {
+                                       w = w * c->obj->cur.scale;
+                                       h = h * c->obj->cur.scale;
+                                    }
+                               }
                           }
                         break;
                      case SIZE_REL: