GPU (Linux): check NULL returned by opendir

Fix #845
This commit is contained in:
李通洲 authored and 李通洲 committed 2024-05-03 09:11:59 +08:00
1 parent 4c0ea7354d
commit 1449290e9e
1 file changed
+2
+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)
{