]> Dogcows Code - chaz/openbox/blobdiff - render/image.c
*** empty log message ***
[chaz/openbox] / render / image.c
index 09d94f17dd7c19c3b4520b3be57c26f318a36b42..393afe84973babece9e74a974ae9104992323b32 100644 (file)
@@ -133,12 +133,15 @@ void RrImageDraw(RrPixel32 *target, RrTextureRGBA *rgba,
 
     /* keep the ratio */
     dw = area->width;
-    dh = (int)(dw * ((double)sh / sw));
+    dh = (gint)(dw * ((gdouble)sh / sw));
     if (dh > area->height) {
         dh = area->height;
-        dw = (int)(dh * ((double)sw / sh));
+        dw = (gint)(dh * ((gdouble)sw / sh));
     }
 
+    if (!(dw && dh))
+        return; /* XXX sanity check */
+
     if (sw != dw || sh != dh) {
         /*if (!(rgba->cache && dw == rgba->cwidth && dh == rgba->cheight))*/ {
             g_free(rgba->cache);
This page took 0.022235 seconds and 4 git commands to generate.