summaryrefslogtreecommitdiff
path: root/BaseTools
diff options
context:
space:
mode:
authorHao Wu <hao.a.wu@intel.com>2016-09-22 09:47:58 +0800
committerHao Wu <hao.a.wu@intel.com>2016-11-08 16:36:40 +0800
commit10bcabc6be01aa72584610844d58c9e041952ca2 (patch)
tree9146fad298f015b34aa8946661924a83cb9ecaee /BaseTools
parent9dd00cb66e3e4a4be38068ef9700137ac6c0fb3f (diff)
downloadedk2-platforms-10bcabc6be01aa72584610844d58c9e041952ca2.tar.xz
BaseTools/TianoCompress: Initialize local variables before being used
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>
Diffstat (limited to 'BaseTools')
-rw-r--r--BaseTools/Source/C/TianoCompress/TianoCompress.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/BaseTools/Source/C/TianoCompress/TianoCompress.c b/BaseTools/Source/C/TianoCompress/TianoCompress.c
index 57253cca8f..b994d933eb 100644
--- a/BaseTools/Source/C/TianoCompress/TianoCompress.c
+++ b/BaseTools/Source/C/TianoCompress/TianoCompress.c
@@ -2153,7 +2153,7 @@ Returns:
UINT16 Start[18];
UINT16 *Pointer;
UINT16 Index3;
- volatile UINT16 Index;
+ UINT16 Index;
UINT16 Len;
UINT16 Char;
UINT16 JuBits;
@@ -2163,7 +2163,7 @@ Returns:
UINT16 WordOfStart;
UINT16 WordOfCount;
- for (Index = 1; Index <= 16; Index++) {
+ for (Index = 0; Index <= 16; Index++) {
Count[Index] = 0;
}
@@ -2171,6 +2171,7 @@ Returns:
Count[BitLen[Index]]++;
}
+ Start[0] = 0;
Start[1] = 0;
for (Index = 1; Index <= 16; Index++) {
@@ -2188,6 +2189,7 @@ Returns:
JuBits = (UINT16) (16 - TableBits);
+ Weight[0] = 0;
for (Index = 1; Index <= TableBits; Index++) {
Start[Index] >>= JuBits;
Weight[Index] = (UINT16) (1U << (TableBits - Index));