- Fix buffer overflow in DIB_BltFromVGA. A byte fits two pixels.

svn path=/trunk/; revision=74382
This commit is contained in:
Thomas Faber 2017-04-20 07:30:01 +00:00
parent e9940a928b
commit 599c80f8f2

View file

@ -369,6 +369,7 @@ void DIB_BltFromVGA(int x, int y, int w, int h, void *b, int Dest_lDelta)
stride = 0;
rightcount = w;
}
rightcount = (rightcount + 1) / 2;
/* Reset the destination. */
for (j = 0; j < h; j++)
@ -414,7 +415,7 @@ void DIB_BltFromVGA(int x, int y, int w, int h, void *b, int Dest_lDelta)
row = UnpackPixel[pixel] << plane;
/* Store the data for each pixel in the destination. */
/* Store the data for each byte in the destination. */
for (i = 0; i < rightcount; i++)
{
((PUCHAR)destline)[i] |= (row & 0xFF);