diff --git a/Changelog.md b/Changelog.md index ffb1fc29..dc6b256a 100644 --- a/Changelog.md +++ b/Changelog.md @@ -4,6 +4,7 @@ OpenCore Changelog - Fixed OSBundleLibraries/OSBundleLibaries64 handling - Added `GraphicsInputMirroring` to fix lost keystrokes in some non-Apple graphical UEFI apps - Added support for stack canaries (security cookies / stack guards) +- Fixed unintialised memory access in AudioDxe causing audio playback failure #### v0.7.1 - Added `SyncTableIds` quirk to sync modified table OEM identifiers diff --git a/Include/Acidanthera/Protocol/HdaIo.h b/Include/Acidanthera/Protocol/HdaIo.h index 53352ae6..93dfd8b2 100644 --- a/Include/Acidanthera/Protocol/HdaIo.h +++ b/Include/Acidanthera/Protocol/HdaIo.h @@ -209,9 +209,15 @@ typedef struct { /// /// Codec address. /// - UINT8 Address; + UINT32 Address; } EFI_HDA_IO_DEVICE_PATH; +STATIC_ASSERT ( + sizeof(EFI_HDA_IO_DEVICE_PATH) + == sizeof(EFI_DEVICE_PATH_PROTOCOL) + sizeof (EFI_GUID) + sizeof (UINT32), + "Unexpected EFI_HDA_IO_DEVICE_PATH size" + ); + extern EFI_GUID gEfiHdaIoDevicePathGuid; /** diff --git a/Staging/AudioDxe/HdaController/HdaController.c b/Staging/AudioDxe/HdaController/HdaController.c index 544cd69e..30e0c52c 100644 --- a/Staging/AudioDxe/HdaController/HdaController.c +++ b/Staging/AudioDxe/HdaController/HdaController.c @@ -488,7 +488,7 @@ HdaControllerScanCodecs ( HdaIoDevicePathNode.Header.Length[0] = (UINT8)(sizeof (EFI_HDA_IO_DEVICE_PATH)); HdaIoDevicePathNode.Header.Length[1] = (UINT8)((sizeof (EFI_HDA_IO_DEVICE_PATH)) >> 8); HdaIoDevicePathNode.Guid = gEfiHdaIoDevicePathGuid; - HdaIoDevicePathNode.Address = (UINT8) Index; + HdaIoDevicePathNode.Address = Index; HdaControllerDev->HdaIoChildren[Index].DevicePath = AppendDevicePathNode (HdaControllerDev->DevicePath, (EFI_DEVICE_PATH_PROTOCOL*)&HdaIoDevicePathNode); if (HdaControllerDev->HdaIoChildren[Index].DevicePath == NULL) { Status = EFI_INVALID_PARAMETER;