Fixed divide by zero if setting integer scale without setting logical width and height
authorSam Lantinga <slouken@libsdl.org>
Fri, 14 Oct 2016 00:51:57 -0700
changeset 10532b576db8b2346
parent 10531 f304bc5dd3b5
child 10533 cd2e0b0c7ec5
Fixed divide by zero if setting integer scale without setting logical width and height
src/render/SDL_render.c
     1.1 --- a/src/render/SDL_render.c	Thu Oct 13 04:57:31 2016 -0700
     1.2 +++ b/src/render/SDL_render.c	Fri Oct 14 00:51:57 2016 -0700
     1.3 @@ -1145,6 +1145,9 @@
     1.4      float scale;
     1.5      SDL_Rect viewport;
     1.6  
     1.7 +    if (!renderer->logical_w || !renderer->logical_h) {
     1.8 +        return 0;
     1.9 +    }
    1.10      if (SDL_GetRendererOutputSize(renderer, &w, &h) < 0) {
    1.11          return -1;
    1.12      }