raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=61b5a4e40b6eb98dd1738c6aad0eb0072f951c52

commit 61b5a4e40b6eb98dd1738c6aad0eb0072f951c52
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
Date:   Wed Aug 27 17:10:02 2014 +0900

    ethumb emotion module - fix possible division by 0
---
 src/modules/ethumb/emotion/emotion.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/modules/ethumb/emotion/emotion.c 
b/src/modules/ethumb/emotion/emotion.c
index de091c9..4443712 100644
--- a/src/modules/ethumb/emotion/emotion.c
+++ b/src/modules/ethumb/emotion/emotion.c
@@ -352,6 +352,7 @@ _thumb_generate(Ethumb *e)
    int r;
    const char *file;
    Ethumb_Thumb_Format f;
+   double dv;
    struct _emotion_plugin *_plugin = calloc(sizeof(struct _emotion_plugin), 1);
 
    o = emotion_object_add(ethumb_evas_get(e));
@@ -376,7 +377,9 @@ _thumb_generate(Ethumb *e)
    _plugin->video = o;
    _plugin->e = e;
 
-   _plugin->ptotal = ethumb_video_time_get(e) / ethumb_video_ntimes_get(e);
+   dv = ethumb_video_ntimes_get(e);
+   if (dv > 0.0) _plugin->ptotal = ethumb_video_time_get(e) / dv;
+   else _plugin->ptotal = 0.0;
    _plugin->pcount = 1;
 
    _resize_movie(_plugin);

-- 


Reply via email to