GB: Fix boundary condition at end of scanline rendering

This commit is contained in:
Jeffrey Pfau 2016-08-30 00:44:34 -07:00
parent bdf647db42
commit c06edae71d
1 changed files with 1 additions and 1 deletions

View File

@ -133,7 +133,7 @@ static void GBVideoSoftwareRendererDrawRange(struct GBVideoRenderer* renderer, i
}
color_t* row = &softwareRenderer->outputBuffer[softwareRenderer->outputBufferStride * y];
int x;
for (x = startX; x < (endX & ~7); x += 8) {
for (x = startX; x + 7 < (endX & ~7); x += 8) {
row[x] = softwareRenderer->palette[softwareRenderer->row[x] & 0x7F];
row[x + 1] = softwareRenderer->palette[softwareRenderer->row[x + 1] & 0x7F];
row[x + 2] = softwareRenderer->palette[softwareRenderer->row[x + 2] & 0x7F];