Skip to content

Commit 601b970

Browse files
committed
Display: report ppi to 0 if screen size is not available
1 parent d48c76b commit 601b970

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/modules/display/display.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ void ffPrintDisplay(FFDisplayOptions* options)
148148
}
149149
else
150150
{
151-
double ppi = sqrt(result->width * result->width + result->height * result->height) / inch;
151+
double ppi = inch == 0 ? 0 : sqrt(result->width * result->width + result->height * result->height) / inch;
152152
bool hdrEnabled = result->hdrStatus == FF_DISPLAY_HDR_STATUS_ENABLED;
153153
bool hdrCompatible = result->hdrStatus == FF_DISPLAY_HDR_STATUS_SUPPORTED || result->hdrStatus == FF_DISPLAY_HDR_STATUS_ENABLED;
154154
uint32_t iInch = (uint32_t) (inch + 0.5), iPpi = (uint32_t) (ppi + 0.5);

0 commit comments

Comments
 (0)