GPU (Linux): check NULL returned by opendir

Fix #845
This commit is contained in:
李通洲
2024-05-03 08:28:20 +08:00
committed by 李通洲
parent 4c0ea7354d
commit 1449290e9e
+2
View File
@@ -46,6 +46,8 @@ static void pciDetectAmdSpecific(const FFGPUOptions* options, FFGPUResult* gpu,
ffStrbufAppendS(pciDir, "/hwmon/");
FF_AUTO_CLOSE_DIR DIR* dirp = opendir(pciDir->chars);
if (!dirp) return;
struct dirent* entry;
while ((entry = readdir(dirp)) != NULL)
{