Fixed divide by zero if setting integer scale without setting logical width and height

Sam Lantinga 2016-10-14 00:51:57 -07:00
parent e4af8ce968
commit 8e2634eb13
1 changed files with 3 additions and 0 deletions

View File

@ -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;
}