Added parameter checks.
This commit is contained in:
parent
d2e08c0aa8
commit
bbcba568f4
@ -292,7 +292,7 @@ static INLINE BYTE* WRITEFIRSTLINEFGBGIMAGE(BYTE* pbDest, BYTE bitmask,
|
||||
/**
|
||||
* Decompress an RLE compressed bitmap.
|
||||
*/
|
||||
static INLINE void RLEDECOMPRESS(const BYTE* pbSrcBuffer, UINT32 cbSrcBuffer,
|
||||
static INLINE BOOL RLEDECOMPRESS(const BYTE* pbSrcBuffer, UINT32 cbSrcBuffer,
|
||||
BYTE* pbDestBuffer,
|
||||
UINT32 rowDelta, UINT32 width, UINT32 height)
|
||||
{
|
||||
@ -310,6 +310,9 @@ static INLINE void RLEDECOMPRESS(const BYTE* pbSrcBuffer, UINT32 cbSrcBuffer,
|
||||
UINT32 advance;
|
||||
RLEEXTRA
|
||||
|
||||
if (!pbSrcBuffer || !pbDestBuffer)
|
||||
return FALSE;
|
||||
|
||||
while (pbSrc < pbEnd)
|
||||
{
|
||||
/* Watch out for the end of the first scanline. */
|
||||
@ -628,6 +631,11 @@ static INLINE void RLEDECOMPRESS(const BYTE* pbSrcBuffer, UINT32 cbSrcBuffer,
|
||||
DESTWRITEPIXEL(pbDest, BLACK_PIXEL);
|
||||
DESTNEXTPIXEL(pbDest);
|
||||
break;
|
||||
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -276,7 +276,7 @@ BOOL interleaved_decompress(BITMAP_INTERLEAVED_CONTEXT* interleaved,
|
||||
UINT32 SrcFormat;
|
||||
UINT32 BufferSize;
|
||||
|
||||
if (!interleaved)
|
||||
if (!interleaved || !pSrcData || !pDstData)
|
||||
return FALSE;
|
||||
|
||||
switch (bpp)
|
||||
@ -322,19 +322,25 @@ BOOL interleaved_decompress(BITMAP_INTERLEAVED_CONTEXT* interleaved,
|
||||
switch (bpp)
|
||||
{
|
||||
case 24:
|
||||
RleDecompress24to24(pSrcData, SrcSize, interleaved->TempBuffer,
|
||||
scanline, nSrcWidth, nSrcHeight);
|
||||
if (!RleDecompress24to24(pSrcData, SrcSize, interleaved->TempBuffer,
|
||||
scanline, nSrcWidth, nSrcHeight))
|
||||
return FALSE;
|
||||
|
||||
break;
|
||||
|
||||
case 16:
|
||||
case 15:
|
||||
RleDecompress16to16(pSrcData, SrcSize, interleaved->TempBuffer,
|
||||
scanline, nSrcWidth, nSrcHeight);
|
||||
if (!RleDecompress16to16(pSrcData, SrcSize, interleaved->TempBuffer,
|
||||
scanline, nSrcWidth, nSrcHeight))
|
||||
return FALSE;
|
||||
|
||||
break;
|
||||
|
||||
case 8:
|
||||
RleDecompress8to8(pSrcData, SrcSize, interleaved->TempBuffer,
|
||||
scanline, nSrcWidth, nSrcHeight);
|
||||
if (!RleDecompress8to8(pSrcData, SrcSize, interleaved->TempBuffer,
|
||||
scanline, nSrcWidth, nSrcHeight))
|
||||
return FALSE;
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
|
Loading…
Reference in New Issue
Block a user