Eet: Fail gracefully on invalid input

Consider infinity and NaN as invalid input for
put_float and put_double, since the underlying convert
function can't process them.

This fixes potential errors with incomplete / invalid evas 3d models
This commit is contained in:
Jean-Philippe Andre 2015-12-29 15:56:24 +09:00
parent cda8ccf770
commit bd32015dfc
1 changed files with 4 additions and 2 deletions

View File

@ -1018,7 +1018,8 @@ eet_data_put_float(Eet_Dictionary *ed,
char buf[128];
int idx;
eina_convert_dtoa((double)(*(float *)src), buf);
if (!eina_convert_dtoa((double)(*(float *)src), buf))
return NULL;
if (!ed)
{
@ -1094,7 +1095,8 @@ eet_data_put_double(Eet_Dictionary *ed,
char buf[128];
int idx;
eina_convert_dtoa((double)(*(double *)src), buf);
if (!eina_convert_dtoa((double)(*(double *)src), buf))
return NULL;
if (!ed)
{