evas/cserve2: fix SIGFPE in expedite test case.
authorJean-Philippe Andre <jp.andre@samsung.com>
Tue, 4 Jun 2013 10:51:13 +0000 (19:51 +0900)
committerCedric Bail <cedric.bail@samsung.com>
Tue, 4 Jun 2013 11:21:16 +0000 (20:21 +0900)
Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
src/bin/evas/evas_cserve2_fonts.c

index 211ee47..3a12305 100644 (file)
@@ -395,9 +395,12 @@ end:
 static unsigned int
 _font_slave_int_shm_prev_calculate(unsigned int size, unsigned int nglyphs)
 {
-   unsigned int average = size / nglyphs;
+   unsigned int average;
    unsigned int newsize;
 
+   if (!nglyphs) return cserve2_shm_size_normalize(1);
+   average = size / nglyphs;
+
    newsize = MIN_GLYPHS * average;
    newsize = cserve2_shm_size_normalize(newsize);
 
@@ -530,7 +533,7 @@ _font_slave_glyphs_load(const void *cmddata, void *data EINA_UNUSED)
         if (!r) // SHM is full
           {
              fi->shmsize = _font_slave_int_shm_prev_calculate
-                (c->usage, total_glyphs);
+                   (c->usage, total_glyphs);
              c = NULL;
              continue;
           }