From 0db1dc430be0b67a6b96f4cf9447b0eaefb0f5b8 Mon Sep 17 00:00:00 2001 From: Rafael Antognolli Date: Fri, 30 Oct 2009 14:30:15 +0000 Subject: [PATCH] Fix ethumb_calculate_fill_from_ratio(). Default values should be assigned to the return variables even if the aspect ratio is 0. SVN revision: 43352 --- legacy/ethumb/src/lib/Ethumb.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/legacy/ethumb/src/lib/Ethumb.c b/legacy/ethumb/src/lib/Ethumb.c index 52eb069641..be4d3f61fd 100644 --- a/legacy/ethumb/src/lib/Ethumb.c +++ b/legacy/ethumb/src/lib/Ethumb.c @@ -1000,13 +1000,14 @@ ethumb_calculate_fill_from_ratio(Ethumb *e, float ia, int *fx, int *fy, int *fw, { float a; - if (ia == 0) - return; - *fw = e->tw; *fh = e->th; *fx = 0; *fy = 0; + + if (ia == 0) + return; + a = e->tw / (float)e->th; if (e->aspect == ETHUMB_THUMB_CROP)