rage thumb - handle silly sized video thumb images sanely

This commit is contained in:
Carsten Haitzler 2016-08-16 16:04:27 +09:00
parent acde989c0a
commit 94cc3073f8
1 changed files with 6 additions and 1 deletions

View File

@ -113,7 +113,7 @@ _cb_loaded(void *data, Evas_Object *obj, void *info EINA_UNUSED)
snprintf(key, sizeof(key), "%i", pos);
evas_object_image_file_set(vidimage, file, key);
evas_object_image_size_get(vidimage, &iw, &ih);
if ((iw <= 0) || (ih <= 0))
if ((iw <= 1) || (ih <= 1))
{
eet_close(ef);
exit(6);
@ -121,6 +121,11 @@ _cb_loaded(void *data, Evas_Object *obj, void *info EINA_UNUSED)
w = 160;
h = (ih * 160) / iw;
if (h < 1) h = 1;
if ((w > 4096) || (h > 4096))
{
eet_close(ef);
exit(6);
}
evas_object_resize(vidimage, w, h);
evas_object_resize(subwin, w, h);
elm_win_render(subwin);