Bug 243511 Fix crash when displaying bitmap with invalid number of colours r=biesi sr=tor

This commit is contained in:
neil%parkwaycc.co.uk 2004-05-13 21:41:03 +00:00
Родитель ad5691b9c8
Коммит 93189a5531
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -258,7 +258,9 @@ NS_METHOD nsBMPDecoder::ProcessData(const char* aBuffer, PRUint32 aCount)
return NS_ERROR_UNEXPECTED;
if (mBIH.bpp <= 8) {
mNumColors = mBIH.colors ? mBIH.colors : 1 << mBIH.bpp;
mNumColors = 1 << mBIH.bpp;
if (mBIH.colors && mBIH.colors < mNumColors)
mNumColors = mBIH.colors;
mColors = new colorTable[mNumColors];
if (!mColors)