[coverity] 1543090 Division or modulo by float zero

This commit is contained in:
Armin Novak 2024-04-15 12:06:34 +02:00 committed by akallabeth
parent 140b4d7fcb
commit 587175fdb8

View File

@ -198,8 +198,17 @@ static BOOL sdl_apply_display_properties(SdlContext* sdl)
float vdpi = 1.0f;
SDL_Rect rect = {};
SDL_GetDisplayBounds(*id, &rect);
SDL_GetDisplayDPI(*id, &ddpi, &hdpi, &vdpi);
if (SDL_GetDisplayBounds(*id, &rect) < 0)
return FALSE;
if (SDL_GetDisplayDPI(*id, &ddpi, &hdpi, &vdpi) < 0)
return FALSE;
WINPR_ASSERT(rect.w > 0);
WINPR_ASSERT(rect.h > 0);
WINPR_ASSERT(ddpi > 0);
WINPR_ASSERT(hdpi > 0);
WINPR_ASSERT(vdpi > 0);
bool highDpi = hdpi > 100;