Skip to content

Commit

Permalink
AudioDxe: Fix DevicePath not to contain padding
Browse files Browse the repository at this point in the history
  • Loading branch information
vit9696 committed Jul 16, 2021
1 parent 554c7cb commit f61a1a3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion Include/Acidanthera/Protocol/HdaIo.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down
2 changes: 1 addition & 1 deletion Staging/AudioDxe/HdaController/HdaController.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f61a1a3

Please sign in to comment.