Eina: Fix potential crash in eina_convert_dtoa

Infinity and NaN should probably just not be converted.

An error would happen in make check while saving evas 3d models.
This commit is contained in:
Jean-Philippe Andre 2015-12-29 15:45:35 +09:00
parent b13502f20a
commit cda8ccf770
1 changed files with 2 additions and 1 deletions

View File

@ -290,7 +290,8 @@ eina_convert_dtoa(double d, char *des)
int p;
int i;
EINA_SAFETY_ON_NULL_RETURN_VAL(des, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(des, 0);
EINA_SAFETY_ON_FALSE_RETURN_VAL(!isnan(d) && !isinf(d), 0);
if (d < 0.0)
{