summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-08-27 17:10:02 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-08-27 17:10:02 +0900
commit61b5a4e40b6eb98dd1738c6aad0eb0072f951c52 (patch)
treef3d663f54b48be90db486a218b827fae27b2a8e5
parentca5e0c6a9da8975a5c9a51d1909cf2bbfc0f943e (diff)
downloadefl-61b5a4e40b6eb98dd1738c6aad0eb0072f951c52.tar.gz
ethumb emotion module - fix possible division by 0
-rw-r--r--src/modules/ethumb/emotion/emotion.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/modules/ethumb/emotion/emotion.c b/src/modules/ethumb/emotion/emotion.c
index de091c90f5..4443712be6 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);