ImageContext,\r
Section->VirtualAddress + Section->Misc.VirtualSize - 1\r
);\r
+ //\r
+ // If the base start or end address resolved to 0, then fail.\r
+ //\r
+ if ((Base == NULL) || (End == NULL)) {\r
+ ImageContext->ImageError = IMAGE_ERROR_SECTION_NOT_LOADED;\r
+ return RETURN_LOAD_ERROR;\r
+ }\r
+\r
if (ImageContext->IsTeImage) {\r
Base = (CHAR8 *) ((UINTN) Base + sizeof (EFI_TE_IMAGE_HEADER) - (UINTN) TeHdr->StrippedSize);\r
End = (CHAR8 *) ((UINTN) End + sizeof (EFI_TE_IMAGE_HEADER) - (UINTN) TeHdr->StrippedSize);\r
if (End > MaxEnd) {\r
MaxEnd = End;\r
}\r
- //\r
- // If the base start or end address resolved to 0, then fail.\r
- //\r
- if ((Base == NULL) || (End == NULL)) {\r
- ImageContext->ImageError = IMAGE_ERROR_SECTION_NOT_LOADED;\r
- return RETURN_LOAD_ERROR;\r
- }\r
\r
//\r
// Read the section\r