Skip to content

Commit

Permalink
OcAppleImageConversion: Fix scale argument handling
Browse files Browse the repository at this point in the history
  • Loading branch information
vit9696 committed May 3, 2020
1 parent 7fd0779 commit 001340f
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions Library/OcAppleImageConversionLib/OcAppleImageConversionLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,23 +123,23 @@ DecodeImageData (
STATIC
EFI_STATUS
EFIAPI
GetImageDimsVersion (
IN VOID *Buffer,
GetImageDimsEx (
IN VOID *Buffer,
IN UINTN BufferSize,
IN UINTN Version,
IN UINTN Scale,
OUT UINT32 *Width,
OUT UINT32 *Height
)
{
if (Buffer == NULL
|| BufferSize == 0
|| Version == 0
|| Scale == 0
|| Width == NULL
|| Height == NULL) {
return EFI_INVALID_PARAMETER;
}

if (Version > APPLE_IMAGE_CONVERSION_PROTOCOL_INTERFACE_V1) {
if (Scale > 1) {
return EFI_UNSUPPORTED;
}

Expand All @@ -149,23 +149,23 @@ GetImageDimsVersion (
STATIC
EFI_STATUS
EFIAPI
DecodeImageDataVersion (
DecodeImageDataEx (
IN VOID *Buffer,
IN UINTN BufferSize,
IN UINTN Version,
IN UINTN Scale,
OUT EFI_UGA_PIXEL **RawImageData,
OUT UINTN *RawImageDataSize
)
{
if (Buffer == NULL
|| BufferSize == 0
|| Version == 0
|| Scale == 0
|| RawImageData == NULL
|| RawImageDataSize == NULL) {
return EFI_INVALID_PARAMETER;
}

if (Version > APPLE_IMAGE_CONVERSION_PROTOCOL_INTERFACE_V1) {
if (Scale > 1) {
return EFI_UNSUPPORTED;
}

Expand All @@ -181,8 +181,8 @@ STATIC APPLE_IMAGE_CONVERSION_PROTOCOL mAppleImageConversion = {
RecognizeImageData,
GetImageDims,
DecodeImageData,
GetImageDimsVersion,
DecodeImageDataVersion
GetImageDimsEx,
DecodeImageDataEx
};

APPLE_IMAGE_CONVERSION_PROTOCOL *
Expand Down

0 comments on commit 001340f

Please sign in to comment.