Skip to content

Commit

Permalink
Fixed divide by zero if setting integer scale without setting logical…
Browse files Browse the repository at this point in the history
… width and height
  • Loading branch information
slouken committed Oct 14, 2016
1 parent e4af8ce commit 8e2634e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/render/SDL_render.c
Expand Up @@ -1145,6 +1145,9 @@ UpdateLogicalSize(SDL_Renderer *renderer)
float scale;
SDL_Rect viewport;

if (!renderer->logical_w || !renderer->logical_h) {
return 0;
}
if (SDL_GetRendererOutputSize(renderer, &w, &h) < 0) {
return -1;
}
Expand Down

0 comments on commit 8e2634e

Please sign in to comment.