X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=render%2Fimage.c;h=393afe84973babece9e74a974ae9104992323b32;hb=5069ed1d614983e17227f9537bef283f93a4f88c;hp=09d94f17dd7c19c3b4520b3be57c26f318a36b42;hpb=16f46c296d1fcd3f27fc62a18e71c55fb3fd3e88;p=chaz%2Fopenbox diff --git a/render/image.c b/render/image.c index 09d94f17..393afe84 100644 --- a/render/image.c +++ b/render/image.c @@ -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);