diff options
Diffstat (limited to 'MdePkg/Library/BaseUefiDecompressLib')
-rw-r--r-- | MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.c b/MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.c index 9d0fd7d131..6dc1b84b87 100644 --- a/MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.c +++ b/MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.c @@ -225,11 +225,13 @@ MakeTable ( Sd->mRight[Avail] = Sd->mLeft[Avail] = 0;
*Pointer = Avail++;
}
-
- if ((Index3 & Mask) != 0) {
- Pointer = &Sd->mRight[*Pointer];
- } else {
- Pointer = &Sd->mLeft[*Pointer];
+
+ if (*Pointer < (2 * NC - 1)) {
+ if ((Index3 & Mask) != 0) {
+ Pointer = &Sd->mRight[*Pointer];
+ } else {
+ Pointer = &Sd->mLeft[*Pointer];
+ }
}
Index3 <<= 1;
|