]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/C/Common/EfiCompress.c
BaseTools: Update BrotliCompress script to handle the different input format
[mirror_edk2.git] / BaseTools / Source / C / Common / EfiCompress.c
index bd86d1276ad80e564a5f4e6d1f13c366b83d5a36..b225fee913bec3369eb4f92cd5137b36a85a59fd 100644 (file)
@@ -408,6 +408,9 @@ Returns:
   UINT32      i;\r
   \r
   mText       = malloc (WNDSIZ * 2 + MAXMATCH);\r
+  if (mText == NULL) {\r
+    return EFI_OUT_OF_RESOURCES;\r
+  }\r
   for (i = 0 ; i < WNDSIZ * 2 + MAXMATCH; i ++) {\r
     mText[i] = 0;\r
   }\r
@@ -418,6 +421,10 @@ Returns:
   mParent     = malloc (WNDSIZ * 2 * sizeof(*mParent));\r
   mPrev       = malloc (WNDSIZ * 2 * sizeof(*mPrev));\r
   mNext       = malloc ((MAX_HASH_VAL + 1) * sizeof(*mNext));\r
+  if (mLevel == NULL || mChildCount == NULL || mPosition == NULL ||\r
+    mParent == NULL || mPrev == NULL || mNext == NULL) {\r
+    return EFI_OUT_OF_RESOURCES;\r
+  }\r
   \r
   mBufSiz = 16 * 1024U;\r
   while ((mBuf = malloc(mBufSiz)) == NULL) {\r