Fix two bugs in GenFfs and GenSec tool to handle the different cases.
authorlgao4 <lgao4@7335b38e-4728-0410-8992-fb3ffe349368>
Wed, 18 Jun 2008 09:16:29 +0000 (09:16 +0000)
committerlgao4 <lgao4@7335b38e-4728-0410-8992-fb3ffe349368>
Wed, 18 Jun 2008 09:16:29 +0000 (09:16 +0000)
git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@1261 7335b38e-4728-0410-8992-fb3ffe349368

Source/C/GenFfs/GenFfs.c
Source/C/GenSec/GenSec.c

index 602bb38..4a1ab66 100644 (file)
@@ -334,7 +334,15 @@ Returns:
       }\r
     } else if (TempSectHeader.Type == EFI_SECTION_PE32) {\r
       (*PESectionNum) ++;\r
+    } else if (TempSectHeader.Type == EFI_SECTION_COMPRESSION || \r
+               TempSectHeader.Type == EFI_SECTION_GUID_DEFINED ||\r
+               TempSectHeader.Type == EFI_SECTION_FIRMWARE_VOLUME_IMAGE) {\r
+      //\r
+      // for the encapsulated section, assume it contains Pe/Te section \r
+      //\r
+      (*PESectionNum) ++;\r
     }\r
+\r
     fseek (InFile, 0, SEEK_SET);\r
 \r
     //\r
index 285cc32..c406a5c 100644 (file)
@@ -1259,6 +1259,10 @@ Returns:
     break;\r
   }\r
   \r
+  if (Status != EFI_SUCCESS || OutFileBuffer == NULL) {\r
+         goto Finish;\r
+  }\r
+\r
   //\r
   // Get output file length\r
   //\r