]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools/TianoCompress: Initialize local variables before being used
authorHao Wu <hao.a.wu@intel.com>
Thu, 22 Sep 2016 01:47:58 +0000 (09:47 +0800)
committerHao Wu <hao.a.wu@intel.com>
Tue, 8 Nov 2016 08:36:40 +0000 (16:36 +0800)
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
BaseTools/Source/C/TianoCompress/TianoCompress.c

index 57253cca8f792de44407e2d6d19f1277dbea432e..b994d933eb4cf4359e45151a26d0580deacd72aa 100644 (file)
@@ -2153,7 +2153,7 @@ Returns:
   UINT16  Start[18];\r
   UINT16  *Pointer;\r
   UINT16  Index3;\r
-  volatile UINT16  Index;\r
+  UINT16  Index;\r
   UINT16  Len;\r
   UINT16  Char;\r
   UINT16  JuBits;\r
@@ -2163,7 +2163,7 @@ Returns:
   UINT16  WordOfStart;\r
   UINT16  WordOfCount;\r
 \r
-  for (Index = 1; Index <= 16; Index++) {\r
+  for (Index = 0; Index <= 16; Index++) {\r
     Count[Index] = 0;\r
   }\r
 \r
@@ -2171,6 +2171,7 @@ Returns:
     Count[BitLen[Index]]++;\r
   }\r
 \r
+  Start[0] = 0;\r
   Start[1] = 0;\r
 \r
   for (Index = 1; Index <= 16; Index++) {\r
@@ -2188,6 +2189,7 @@ Returns:
 \r
   JuBits = (UINT16) (16 - TableBits);\r
 \r
+  Weight[0] = 0;\r
   for (Index = 1; Index <= TableBits; Index++) {\r
     Start[Index] >>= JuBits;\r
     Weight[Index] = (UINT16) (1U << (TableBits - Index));\r