evas: simplify path logic and make backend code more robust.

Fix CID 1039665.
This commit is contained in:
Cedric BAIL 2014-03-13 10:57:38 +09:00
parent 522cb7756d
commit d3bc06ae33
2 changed files with 2 additions and 1 deletions

View 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);

View 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);