diff --git a/WhateverGreen/kern_igfx.cpp b/WhateverGreen/kern_igfx.cpp index 71abd584..706a8096 100644 --- a/WhateverGreen/kern_igfx.cpp +++ b/WhateverGreen/kern_igfx.cpp @@ -1062,25 +1062,28 @@ bool IGFX::applySklAsKblPatches(IOService *that) { // The removal of profile 2 under VTSupportedProfileArray allows fallback to software encoding/decoding. // Thanks dhinakg and aben for finding this. const char *hevcCapProps[] = { "IOGVAHEVCDecodeCapabilities", "IOGVAHEVCEncodeCapabilities" }; + bool found = false; for (auto prop : hevcCapProps) { + found = false; + auto hevcCap = OSDynamicCast(OSDictionary, that->getProperty(prop)); if (!hevcCap) - return false; + continue; auto newHevcCap = OSDictionary::withDictionary(hevcCap); if (!newHevcCap) - return false; + continue; auto vtSuppProf = OSDynamicCast(OSArray, newHevcCap->getObject("VTSupportedProfileArray")); if (!vtSuppProf) { newHevcCap->release(); - return false; + continue; } auto newVtSuppProf = OSArray::withArray(vtSuppProf); if (!newVtSuppProf) { newHevcCap->release(); - return false; + continue; } unsigned int count = newVtSuppProf->getCount(); @@ -1089,12 +1092,13 @@ bool IGFX::applySklAsKblPatches(IOService *that) { if (!num) { newVtSuppProf->release(); newHevcCap->release(); - return false; + continue; } if (num->unsigned8BitValue() == 2) { DBGLOG("igfx", "removing profile 2 from VTSupportedProfileArray/%s index %u on Skylake with KBL kexts", prop, i); newVtSuppProf->removeObject(i); + found = true; break; } } @@ -1106,7 +1110,7 @@ bool IGFX::applySklAsKblPatches(IOService *that) { newHevcCap->release(); } - return true; + return found; } bool IGFX::wrapAcceleratorStart(IOService *that, IOService *provider) {