Merge pull request #5274 from chipitsine/master
libfreerdp/codec/include/bitmap.c: resolve possible NULL pointer arithmetic
This commit is contained in:
commit
1b0ed37dce
@ -92,8 +92,8 @@ static INLINE BOOL RLEDECOMPRESS(const BYTE* pbSrcBuffer, UINT32 cbSrcBuffer,
|
||||
UINT32 rowDelta, UINT32 width, UINT32 height)
|
||||
{
|
||||
const BYTE* pbSrc = pbSrcBuffer;
|
||||
const BYTE* pbEnd = pbSrcBuffer + cbSrcBuffer;
|
||||
const BYTE* pbDestEnd = pbDestBuffer + rowDelta * height;
|
||||
const BYTE* pbEnd;
|
||||
const BYTE* pbDestEnd;
|
||||
BYTE* pbDest = pbDestBuffer;
|
||||
PIXEL temp;
|
||||
PIXEL fgPel = WHITE_PIXEL;
|
||||
@ -112,6 +112,9 @@ static INLINE BOOL RLEDECOMPRESS(const BYTE* pbSrcBuffer, UINT32 cbSrcBuffer,
|
||||
if (!pbSrcBuffer || !pbDestBuffer)
|
||||
return FALSE;
|
||||
|
||||
pbEnd = pbSrcBuffer + cbSrcBuffer;
|
||||
pbDestEnd = pbDestBuffer + rowDelta * height;
|
||||
|
||||
while (pbSrc < pbEnd)
|
||||
{
|
||||
/* Watch out for the end of the first scanline. */
|
||||
|
Loading…
Reference in New Issue
Block a user