From 55b3163520197148556aeb8ea2e7f779d54b0dc5 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Fri, 30 May 2014 23:11:09 +0100 Subject: Reduce scope of a variable. --- riscos/thumbnail.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/riscos/thumbnail.c b/riscos/thumbnail.c index 66864554b..2bdd37251 100644 --- a/riscos/thumbnail.c +++ b/riscos/thumbnail.c @@ -85,7 +85,6 @@ bool thumbnail_create(hlcache_handle *content, struct bitmap *bitmap, struct thumbnail_save_area *save_area; osspriteop_area *sprite_area = NULL; osspriteop_header *sprite_header = NULL; - _kernel_oserror *error; struct redraw_context ctx = { .interactive = false, .background_images = true, @@ -137,6 +136,8 @@ bool thumbnail_create(hlcache_handle *content, struct bitmap *bitmap, /* if we changed to 8bpp then go back to 32bpp */ if (thumbnail_32bpp_available != 1) { const uint8_t *pixbufp = bitmap_get_buffer(bitmap); + _kernel_oserror *error; + if (!pixbufp || !bitmap->sprite_area) { free(sprite_area); return false; -- cgit v1.2.3