From 14531b13909c611730888ce9228f715d33f0ea73 Mon Sep 17 00:00:00 2001 From: lgao4 Date: Mon, 24 May 2010 02:45:17 +0000 Subject: [PATCH] Use the ASSERT() for parameter checking as the 4th parameter of internal worker function of MakeTable() must be <= 16. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10540 6f19259b-4bc3-4df7-8a09-765794883524 --- .../BaseUefiTianoCustomDecompressLib.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.c b/IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.c index 6a0e5eca45..fb60d029a8 100644 --- a/IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.c +++ b/IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.c @@ -108,6 +108,7 @@ GetBits ( Creates Huffman Code mapping table for Extra Set, Char&Len Set and Position Set according to code length array. + If TableBits > 16, then ASSERT (). @param Sd The global scratch data @param NumOfChar Number of symbols in the symbol set @@ -143,6 +144,12 @@ MakeTable ( UINT16 WordOfStart; UINT16 WordOfCount; + // + // The maximum mapping table width supported by this internal + // working function is 16. + // + ASSERT (TableBits <= 16); + for (Index = 0; Index <= 16; Index++) { Count[Index] = 0; } -- 2.39.2