summaryrefslogtreecommitdiff
path: root/src/lib/eet
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-12-29 15:56:24 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-12-29 16:19:02 +0900
commitbd32015dfc13e2a31a250e7046036f81030cfb96 (patch)
tree5b02a74bbc182668527f0877805771958d721524 /src/lib/eet
parentcda8ccf7705cdc83c0a4ebabc8bb326ee043f58d (diff)
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
Diffstat (limited to 'src/lib/eet')
-rw-r--r--src/lib/eet/eet_data.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/eet/eet_data.c b/src/lib/eet/eet_data.c
index ad2fe47090..eb5a44aba2 100644
--- a/src/lib/eet/eet_data.c
+++ b/src/lib/eet/eet_data.c
@@ -1018,7 +1018,8 @@ eet_data_put_float(Eet_Dictionary *ed,
1018 char buf[128]; 1018 char buf[128];
1019 int idx; 1019 int idx;
1020 1020
1021 eina_convert_dtoa((double)(*(float *)src), buf); 1021 if (!eina_convert_dtoa((double)(*(float *)src), buf))
1022 return NULL;
1022 1023
1023 if (!ed) 1024 if (!ed)
1024 { 1025 {
@@ -1094,7 +1095,8 @@ eet_data_put_double(Eet_Dictionary *ed,
1094 char buf[128]; 1095 char buf[128];
1095 int idx; 1096 int idx;
1096 1097
1097 eina_convert_dtoa((double)(*(double *)src), buf); 1098 if (!eina_convert_dtoa((double)(*(double *)src), buf))
1099 return NULL;
1098 1100
1099 if (!ed) 1101 if (!ed)
1100 { 1102 {