From: Dana Jansens Date: Sun, 23 Mar 2003 17:32:07 +0000 (+0000) Subject: add more size checks X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=6adb3d44544f0c740b63b07d2f9cfb9a1a83814a;p=chaz%2Fopenbox add more size checks --- diff --git a/render/render.c b/render/render.c index 7129974c..397cebfa 100644 --- a/render/render.c +++ b/render/render.c @@ -92,7 +92,7 @@ void x_paint(Window win, Appearance *l, int x, int y, int w, int h) XImage *im = NULL; Pixmap oldp; - if (w <= 0 || h <= 0) return; + if (w <= 0 || h <= 0 || x+w <= 0 || y+h <= 0) return; g_assert(l->surface.type == Surface_Planar); @@ -106,8 +106,7 @@ void x_paint(Window win, Appearance *l, int x, int y, int w, int h) render_colormap); g_assert(l->xftdraw != NULL); - if (l->surface.data.planar.pixel_data != NULL) - g_free(l->surface.data.planar.pixel_data); + g_free(l->surface.data.planar.pixel_data); l->surface.data.planar.pixel_data = g_new(pixel32, w * h); if (l->surface.data.planar.grad == Background_Solid)