summaryrefslogtreecommitdiffstats
path: root/BaseTools
diff options
context:
space:
mode:
authorYonghong Zhu <yonghong.zhu@intel.com>2016-11-29 10:09:17 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2016-11-30 12:26:51 +0800
commite148e6e9625f8a0054f131bacba4e5c9a21a4377 (patch)
tree46285f3a3ab944444a275e37b26abbc4882314e9 /BaseTools
parent60a5378208f8b60e0a04ac724a639ad19158e778 (diff)
downloadedk2-e148e6e9625f8a0054f131bacba4e5c9a21a4377.tar.gz
edk2-e148e6e9625f8a0054f131bacba4e5c9a21a4377.tar.bz2
edk2-e148e6e9625f8a0054f131bacba4e5c9a21a4377.zip
BaseTools: fix the bug to add PaletteSize info into AutoGen
Fix the bug to add PaletteSize info into AutoGen.c when the flag UEFI_HII_RESOURCE_SECTION is set to FALSE. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools')
-rw-r--r--BaseTools/Source/Python/AutoGen/GenC.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/BaseTools/Source/Python/AutoGen/GenC.py b/BaseTools/Source/Python/AutoGen/GenC.py
index de6eb0ee78..63cfe0422b 100644
--- a/BaseTools/Source/Python/AutoGen/GenC.py
+++ b/BaseTools/Source/Python/AutoGen/GenC.py
@@ -1695,10 +1695,11 @@ def CreateIdfFileCode(Info, AutoGenC, StringH, IdfGenCFlag, IdfGenBinBuffer):
TempBuffer, TempPalette = BmpImageDecoder(File, Buffer, PaletteIndex, FileObj.TransParent)
if len(TempPalette) > 1:
PaletteIndex += 1
- PaletteBuffer += pack('H', len(TempPalette))
- PaletteBuffer += TempPalette
+ NewPalette = pack('H', len(TempPalette))
+ NewPalette += TempPalette
+ PaletteBuffer += NewPalette
PaletteStr = WriteLine(PaletteStr, '// %s: %s: %s' % (DecToHexStr(PaletteIndex - 1, 4), ID, DecToHexStr(PaletteIndex - 1, 4)))
- TempPaletteList = AscToHexList(TempPalette)
+ TempPaletteList = AscToHexList(NewPalette)
PaletteStr = WriteLine(PaletteStr, CreateArrayItem(TempPaletteList, 16) + '\n')
ImageBuffer += TempBuffer
BufferStr = WriteLine(BufferStr, '// %s: %s: %s' % (DecToHexStr(Index, 4), ID, DecToHexStr(Index, 4)))