ethumb emotion module - fix possible division by 0

This commit is contained in:
Carsten Haitzler 2014-08-27 17:10:02 +09:00
parent ca5e0c6a9d
commit 61b5a4e40b
1 changed files with 4 additions and 1 deletions

View File

@ -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);