Display: report ppi to 0 if screen size is not available

This commit is contained in:
李通洲
2024-11-21 21:44:05 +08:00
parent d48c76b597
commit 601b9706b5
+1 -1
View File
@@ -148,7 +148,7 @@ void ffPrintDisplay(FFDisplayOptions* options)
}
else
{
double ppi = sqrt(result->width * result->width + result->height * result->height) / inch;
double ppi = inch == 0 ? 0 : sqrt(result->width * result->width + result->height * result->height) / inch;
bool hdrEnabled = result->hdrStatus == FF_DISPLAY_HDR_STATUS_ENABLED;
bool hdrCompatible = result->hdrStatus == FF_DISPLAY_HDR_STATUS_SUPPORTED || result->hdrStatus == FF_DISPLAY_HDR_STATUS_ENABLED;
uint32_t iInch = (uint32_t) (inch + 0.5), iPpi = (uint32_t) (ppi + 0.5);