summaryrefslogtreecommitdiff
path: root/src/lib/evas/cserve2/evas_cs2_utils.c
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2013-06-04 19:40:36 +0900
committerCedric Bail <cedric.bail@samsung.com>2013-06-04 20:20:55 +0900
commita5329fc680101df9234df44f61b0db2fc42f8a7c (patch)
treeabfe6dc16d51f1985c4ffa4ff393cc2a7af08e4c /src/lib/evas/cserve2/evas_cs2_utils.c
parent20834f09251c41c1e06ff2d2ff9c4c2e31ffd890 (diff)
evas/cserve2: add lots of error checks in the client side.
It seems some images are fully loaded even when we request only preload. The load handler will take care of both cases anyway. Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
Diffstat (limited to 'src/lib/evas/cserve2/evas_cs2_utils.c')
-rw-r--r--src/lib/evas/cserve2/evas_cs2_utils.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/lib/evas/cserve2/evas_cs2_utils.c b/src/lib/evas/cserve2/evas_cs2_utils.c
index b1a3df28ea..5f738cad2c 100644
--- a/src/lib/evas/cserve2/evas_cs2_utils.c
+++ b/src/lib/evas/cserve2/evas_cs2_utils.c
@@ -74,6 +74,8 @@ fash_gl_find(Fash_Glyph2 *fash, int item)
74{ 74{
75 int grp, maj, min; 75 int grp, maj, min;
76 76
77 EINA_SAFETY_ON_NULL_RETURN_VAL(fash, NULL);
78
77 // 24bits for unicode - v6 up to E01EF (chrs) & 10FFFD for private use (plane 16) 79 // 24bits for unicode - v6 up to E01EF (chrs) & 10FFFD for private use (plane 16)
78 grp = (item >> 16) & 0xff; 80 grp = (item >> 16) & 0xff;
79 maj = (item >> 8) & 0xff; 81 maj = (item >> 8) & 0xff;
@@ -88,6 +90,8 @@ fash_gl_add(Fash_Glyph2 *fash, int item, void *glyph)
88{ 90{
89 int grp, maj, min; 91 int grp, maj, min;
90 92
93 EINA_SAFETY_ON_NULL_RETURN(fash);
94
91 // 24bits for unicode - v6 up to E01EF (chrs) & 10FFFD for private use (plane 16) 95 // 24bits for unicode - v6 up to E01EF (chrs) & 10FFFD for private use (plane 16)
92 grp = (item >> 16) & 0xff; 96 grp = (item >> 16) & 0xff;
93 maj = (item >> 8) & 0xff; 97 maj = (item >> 8) & 0xff;
@@ -107,6 +111,8 @@ fash_gl_del(Fash_Glyph2 *fash, int item)
107 int grp, maj, min; 111 int grp, maj, min;
108 void *data; 112 void *data;
109 113
114 EINA_SAFETY_ON_NULL_RETURN(fash);
115
110 // 24bits for unicode - v6 up to E01EF (chrs) & 10FFFD for private use (plane 16) 116 // 24bits for unicode - v6 up to E01EF (chrs) & 10FFFD for private use (plane 16)
111 grp = (item >> 16) & 0xff; 117 grp = (item >> 16) & 0xff;
112 maj = (item >> 8) & 0xff; 118 maj = (item >> 8) & 0xff;
@@ -116,6 +122,7 @@ fash_gl_del(Fash_Glyph2 *fash, int item)
116 if (!fash->bucket[grp]->bucket[maj]->item[min]) return; 122 if (!fash->bucket[grp]->bucket[maj]->item[min]) return;
117 123
118 data = fash->bucket[grp]->bucket[maj]->item[min]; 124 data = fash->bucket[grp]->bucket[maj]->item[min];
119 fash->free_cb(data); 125 if (fash->free_cb)
126 fash->free_cb(data);
120 fash->bucket[grp]->bucket[maj]->item[min] = NULL; 127 fash->bucket[grp]->bucket[maj]->item[min] = NULL;
121} 128}