if (vBarUpdate)
{
UINT32 x;
- BYTE* pSrcPixel;
+ BYTE* pSrcPixel = NULL;
BYTE* dstBuffer;
if (clear->VBarStorageCursor >= CLEARCODEC_VBAR_SIZE)
if ((y + count) > vBarPixelCount)
count = (vBarPixelCount > y) ? (vBarPixelCount - y) : 0;
- pSrcPixel =
- &vBarShortEntry->pixels[(y - vBarYOn) * GetBytesPerPixel(clear->format)];
+ if (count > 0)
+ pSrcPixel =
+ &vBarShortEntry->pixels[(y - vBarYOn) * GetBytesPerPixel(clear->format)];
for (x = 0; x < count; x++)
{
static BOOL nsc_rle_decode(BYTE* in, BYTE* out, UINT32 outSize, UINT32 originalSize)
{
- UINT32 len;
- UINT32 left;
- BYTE value;
- left = originalSize;
+ UINT32 left = originalSize;
while (left > 4)
{
- value = *in++;
+ const BYTE value = *in++;
+ UINT32 len = 0;
if (left == 5)
{
else
{
in++;
- len = *((UINT32*)in);
- in += 4;
+ len = ((UINT32)(*in++));
+ len |= ((UINT32)(*in++)) << 8U;
+ len |= ((UINT32)(*in++)) << 16U;
+ len |= ((UINT32)(*in++)) << 24U;
}
if (outSize < len)
sign[index] = input;
}
- buffer[index] += (input << shift);
+ buffer[index] += (INT16)((UINT32)input << shift);
}
return 1;