forked from enlightenment/efl
* evas: Fix segv source by checking result before using it.
SVN revision: 45301
This commit is contained in:
parent
f55cf1cfa8
commit
6a0668110d
|
@ -1944,8 +1944,13 @@ _layout_text_append(Ctxt *c, Evas_Object_Textblock_Format *fmt, Evas_Object_Text
|
|||
it = (Evas_Object_Textblock_Item *)(EINA_INLIST_GET(c->ln->items))->last;
|
||||
_layout_strip_trailing_whitespace(c, fmt, it);
|
||||
twrap = _layout_word_end(str, wrap);
|
||||
ch = evas_common_font_utf8_get_next((unsigned char *)str, &twrap);
|
||||
str = str + twrap;
|
||||
if (twrap >= 0)
|
||||
{
|
||||
ch = evas_common_font_utf8_get_next((unsigned char *)str, &twrap);
|
||||
str = str + twrap;
|
||||
}
|
||||
else
|
||||
str = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1973,9 +1978,11 @@ _layout_text_append(Ctxt *c, Evas_Object_Textblock_Format *fmt, Evas_Object_Text
|
|||
wrap = 0;
|
||||
twrap = _layout_word_end(it->text, wrap);
|
||||
wrap = twrap;
|
||||
ch = evas_common_font_utf8_get_next((unsigned char *)str, &wrap);
|
||||
if (twrap >= 0)
|
||||
_layout_item_text_cutoff(c, it, twrap);
|
||||
{
|
||||
ch = evas_common_font_utf8_get_next((unsigned char *)str, &wrap);
|
||||
_layout_item_text_cutoff(c, it, twrap);
|
||||
}
|
||||
if (wrap > 0)
|
||||
str = str + wrap;
|
||||
else
|
||||
|
|
|
@ -42,16 +42,16 @@ evas_image_load_file_head_eet(Image_Entry *ie, const char *file, const char *key
|
|||
}
|
||||
ok = eet_data_image_header_read(ef, key,
|
||||
&w, &h, &alpha, &compression, &quality, &lossy);
|
||||
if (IMG_TOO_BIG(w, h))
|
||||
{
|
||||
*error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
|
||||
goto on_error;
|
||||
}
|
||||
if (!ok)
|
||||
{
|
||||
*error = EVAS_LOAD_ERROR_DOES_NOT_EXIST;
|
||||
goto on_error;
|
||||
}
|
||||
if (IMG_TOO_BIG(w, h))
|
||||
{
|
||||
*error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
|
||||
goto on_error;
|
||||
}
|
||||
if (alpha) ie->flags.alpha = 1;
|
||||
ie->w = w;
|
||||
ie->h = h;
|
||||
|
|
Loading…
Reference in New Issue