From 52eeea4fa59c15ecb09c32b8e05653f4e55f5188 Mon Sep 17 00:00:00 2001 From: Doug Zongker Date: Tue, 4 Sep 2012 14:28:25 -0700 Subject: minor recovery fixes - protect against missing/malformed bitmaps: fail to display them but don't crash. - don't draw animation overlays until the overlay offset is computed. - logging cleanup Change-Id: Ieb1c155cfbb11e643000bdb5d1a57900c8757739 --- minui/graphics.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'minui/graphics.c') diff --git a/minui/graphics.c b/minui/graphics.c index 88572a878..287878e92 100644 --- a/minui/graphics.c +++ b/minui/graphics.c @@ -245,6 +245,9 @@ int gr_text(int x, int y, const char *s) } void gr_texticon(int x, int y, gr_surface icon) { + if (gr_context == NULL || icon == NULL) { + return; + } GGLContext* gl = gr_context; gl->bindTexture(gl, (GGLSurface*) icon); @@ -268,7 +271,7 @@ void gr_fill(int x, int y, int w, int h) } void gr_blit(gr_surface source, int sx, int sy, int w, int h, int dx, int dy) { - if (gr_context == NULL) { + if (gr_context == NULL || source == NULL) { return; } GGLContext *gl = gr_context; -- cgit v1.2.3