Skip to content

Commit 6862747

Browse files
committed
GPU (macOS): fix possible segfault when detecting GPU frequency (M1 Air)
Fix #1122
1 parent f91be64 commit 6862747

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/detection/gpu/gpu_apple.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ static const char* detectFrequency(FFGPUResult* gpu)
5353
return "\"pmgr\" should conform to \"AppleARMIODevice\"";
5454

5555
FF_CFTYPE_AUTO_RELEASE CFDataRef freqProperty = (CFDataRef) IORegistryEntryCreateCFProperty(entryDevice, CFSTR("voltage-states9-sram"), kCFAllocatorDefault, kNilOptions);
56-
if (CFGetTypeID(freqProperty) != CFDataGetTypeID())
56+
if (!freqProperty || CFGetTypeID(freqProperty) != CFDataGetTypeID())
5757
return "\"voltage-states9-sram\" in \"pmgr\" is not found";
5858

5959
// voltage-states5-sram stores supported <frequency / voltage> pairs of gpu from the lowest to the highest

0 commit comments

Comments
 (0)