//\r
*SectionAttribute = ((EFI_GUID_DEFINED_SECTION2 *) InputSection)->Attributes;\r
*ScratchBufferSize = 0;\r
- *OutputBufferSize = SECTION2_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION2 *) InputSection)->DataOffset;\r
+ *OutputBufferSize = SECTION2_SIZE (InputSection) - sizeof(RSA_2048_SHA_256_SECTION2_HEADER);\r
} else {\r
//\r
// Check whether the input guid section is recognized.\r
//\r
*SectionAttribute = ((EFI_GUID_DEFINED_SECTION *) InputSection)->Attributes;\r
*ScratchBufferSize = 0;\r
- *OutputBufferSize = SECTION_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset;\r
+ *OutputBufferSize = SECTION_SIZE (InputSection) - sizeof(RSA_2048_SHA_256_SECTION_HEADER);\r
}\r
\r
return EFI_SUCCESS;\r