]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/Atapi.c
IntelFrameworkModulePkg/IdeBusDxe: Fix undefined behavior in signed left shift
[mirror_edk2.git] / IntelFrameworkModulePkg / Bus / Pci / IdeBusDxe / Atapi.c
index 1a3cb2e0a09d3dadf6c2d7b7502115d0990e8ef6..c641dc5714bcc5d678aa0d4ed9bb4e9fdfd39988 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
    This file contains all helper functions on the ATAPI command \r
   \r
-  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials                          \r
   are licensed and made available under the terms and conditions of the BSD License         \r
   which accompanies this distribution.  The full text of the license may be found at        \r
@@ -1053,7 +1053,7 @@ AtapiReadCapacity (
        if (!EFI_ERROR (Status) && *SResult == SenseNoSenseKey) {\r
       if (IdeDev->Type == IdeCdRom) {\r
 \r
-        IdeDev->BlkIo.Media->LastBlock = (Data.LastLba3 << 24) |\r
+        IdeDev->BlkIo.Media->LastBlock = ((UINT32) Data.LastLba3 << 24) |\r
           (Data.LastLba2 << 16) |\r
           (Data.LastLba1 << 8) |\r
           Data.LastLba0;\r
@@ -1076,7 +1076,7 @@ AtapiReadCapacity (
           IdeDev->BlkIo.Media->LastBlock    = 0;\r
         } else {\r
 \r
-          IdeDev->BlkIo.Media->LastBlock =  (FormatData.LastLba3 << 24) |\r
+          IdeDev->BlkIo.Media->LastBlock = ((UINT32) FormatData.LastLba3 << 24) |\r
             (FormatData.LastLba2 << 16) | \r
             (FormatData.LastLba1 << 8)  |\r
             FormatData.LastLba0;\r