From 5fccc31519ba544c9938c11d951e05958185f99a Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Mon, 28 Apr 2008 03:04:26 +0000 Subject: [PATCH] fix bug in eet decode of list and hashes of simple types. a bug waiting to happen for sure. SVN revision: 34384 --- legacy/eet/ChangeLog | 8 ++++++++ legacy/eet/src/lib/eet_data.c | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/legacy/eet/ChangeLog b/legacy/eet/ChangeLog index bcddfda6d2..6d491b8c11 100644 --- a/legacy/eet/ChangeLog +++ b/legacy/eet/ChangeLog @@ -1,3 +1,11 @@ 2008-04-20 Carsten Haitzler (The Rasterman) 1.0.0 release + +2008-04-28 Carsten Haitzler (The Rasterman) + + * Fixed allocation of a list (EET_G_LIST) of simple types + (IS_SIMPLE_TYPE) to alloc the correct amount (using the correct type + offset). Also fixed a hash (EET_G_HASH) of simple types too. + + diff --git a/legacy/eet/src/lib/eet_data.c b/legacy/eet/src/lib/eet_data.c index 96541f5fa6..33e71fa87d 100644 --- a/legacy/eet/src/lib/eet_data.c +++ b/legacy/eet/src/lib/eet_data.c @@ -2111,7 +2111,7 @@ _eet_data_descriptor_decode(const Eet_Dictionary *ed, data_ret = NULL; if (IS_SIMPLE_TYPE(type)) { - data_ret = calloc(1, eet_coder[type].size); + data_ret = calloc(1, eet_coder[type - 1].size); if (data_ret) { _eet_freelist_add(data_ret); @@ -2171,7 +2171,7 @@ _eet_data_descriptor_decode(const Eet_Dictionary *ed, if (!echnk.name) goto error; if (IS_SIMPLE_TYPE(type)) { - data_ret = calloc(1, eet_coder[type].size); + data_ret = calloc(1, eet_coder[type - 1].size); if (data_ret) { _eet_freelist_add(data_ret);