cedric pushed a commit to branch master.

commit 6531423fd732bc06c9beaef2217ee3ec2db95f6b
Author: Jean-Philippe Andre <[email protected]>
Date:   Tue Jun 4 19:51:13 2013 +0900

    evas/cserve2: fix SIGFPE in expedite test case.
    
    Signed-off-by: Cedric Bail <[email protected]>
---
 src/bin/evas/evas_cserve2_fonts.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/bin/evas/evas_cserve2_fonts.c 
b/src/bin/evas/evas_cserve2_fonts.c
index 211ee47..3a12305 100644
--- a/src/bin/evas/evas_cserve2_fonts.c
+++ b/src/bin/evas/evas_cserve2_fonts.c
@@ -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;
           }

-- 

------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j

Reply via email to