Fix ethumb_calculate_fill_from_ratio().
authorRafael Antognolli <antognolli@gmail.com>
Fri, 30 Oct 2009 14:30:15 +0000 (14:30 +0000)
committerRafael Antognolli <antognolli@gmail.com>
Fri, 30 Oct 2009 14:30:15 +0000 (14:30 +0000)
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

index 52eb069..be4d3f6 100644 (file)
@@ -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)