evas: simplify path logic and make backend code more robust.
authorCedric BAIL <cedric.bail@samsung.com>
Thu, 13 Mar 2014 01:57:38 +0000 (10:57 +0900)
committerCedric BAIL <cedric.bail@samsung.com>
Thu, 13 Mar 2014 01:57:38 +0000 (10:57 +0900)
Fix CID 1039665.

src/lib/evas/canvas/evas_font_dir.c
src/lib/evas/common/evas_font_load.c

index a4d59bc17c6e62471e0323fa91367593388452d4..1eed53a40c8a30cb5a18fe911f25c55520c5da89 100644 (file)
@@ -633,7 +633,7 @@ evas_font_load(Evas *eo_evas, Evas_Font_Description *fdesc, const char *source,
                                 int fsize = 0;
 
                                 fdata = eet_read(ef, nm, &fsize);
-                                if ((fdata) && (fsize > 0))
+                                if (fdata)
                                   {
                                      font = evas->engine.func->font_memory_load(evas->engine.data.output, source, nm, size, fdata, fsize, wanted_rend);
                                      free(fdata);
index 8b1991efe5dcf2a2a6b2ef3595a263a324ce1bef..92fdd243c809b2f300dd7b6c94a42800fb8f0150 100644 (file)
@@ -135,6 +135,7 @@ evas_common_font_source_memory_load(const char *name, const void *data, int data
    RGBA_Font_Source *fs;
 
    assert(name != NULL);
+   if (data_size <= 0) return NULL;
    fs = calloc(1, sizeof(RGBA_Font_Source) + data_size);
    if (!fs) return NULL;
    fs->data = ((unsigned char *)fs) + sizeof(RGBA_Font_Source);