From 4f52b46206ef7c4886349f7bf2c2ab047e81523d Mon Sep 17 00:00:00 2001 From: John Hawthorn Date: Fri, 27 Jun 2008 12:54:03 -0700 Subject: 2 minor bugs --- src/bmp.c | 1 + src/main.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bmp.c b/src/bmp.c index 23780f3..6d0daa2 100644 --- a/src/bmp.c +++ b/src/bmp.c @@ -84,6 +84,7 @@ struct image *bmp_open(FILE *f){ if(b->bpp >= 16){ b->rowwidth = b->img.width * b->bpp / 8; + b->colours = NULL; }else{ int i; b->colours = malloc(b->ncolors * sizeof(struct rgb_t)); diff --git a/src/main.c b/src/main.c index ecefda4..e79af03 100644 --- a/src/main.c +++ b/src/main.c @@ -161,7 +161,8 @@ void run(){ img->fmt->close(img); continue; /* Allow for some events to be read, read is slow */ } - ximg = getimage(img, width, height); + if(!ximg) + ximg = getimage(img, width, height); drawimage(ximg, width, height); redraw = 0; } -- cgit v1.2.3