From b3f1b213a6c389d262a55b9513d9f08fc7c1b9de Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Thu, 17 Jan 2008 13:45:24 +0100 Subject: [PATCH] don't draw if icon is not valid --- widgets/iconbox.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/widgets/iconbox.c b/widgets/iconbox.c index 62e12ab03..57a07e7d8 100644 --- a/widgets/iconbox.c +++ b/widgets/iconbox.c @@ -37,6 +37,10 @@ iconbox_draw(Widget *widget, DrawCtx *ctx, int offset, Data *d = widget->data; Area area = draw_get_image_size(d->image); + /* image not valid */ + if(area.width < 0 || area.height < 0) + return (widget->area.width = 0); + if(d->resize) widget->area.width = ((double) widget->statusbar->height / area.height) * area.width; else