# HG changeset patch # User Matti Hamalainen # Date 1509923353 -7200 # Node ID 9b791519368314758ee49d4dd2fb0d1ef98c9433 # Parent 56f643d647b772c14317f3ab236ee40ea0d54f40 Cleanups. diff -r 56f643d647b7 -r 9b7915193683 tools/view64.c --- a/tools/view64.c Sun Nov 05 23:27:53 2017 +0200 +++ b/tools/view64.c Mon Nov 06 01:09:13 2017 +0200 @@ -230,11 +230,11 @@ DMImage bmap; int ret; - bmap.size = surf->pitch * cimage->height; + bmap.size = surf->pitch * surf->h; bmap.data = surf->pixels; bmap.pitch = surf->pitch; - bmap.width = cimage->width; - bmap.height = cimage->height; + bmap.width = surf->w; + bmap.height = surf->h; bmap.constpal = TRUE; if (fmt->convertFrom != NULL) @@ -347,6 +347,7 @@ switch (event.key.keysym.sym) { case SDLK_ESCAPE: + case SDLK_q: exitFlag = TRUE; break; @@ -381,7 +382,7 @@ break; case SDL_QUIT: - exit(0); + goto exit; } if (currIndex != prevIndex) @@ -403,7 +404,7 @@ goto fail; } - if (fmt == NULL) + if (fmt == NULL || cimage == NULL) { dmErrorMsg("Probing could not find any matching image format. Perhaps try forcing a format via -f.\n"); goto fail;