mirror of https://github.com/mgba-emu/mgba.git
GB: Fix running beyond the end of the video buffer
This commit is contained in:
parent
3ead128a2d
commit
dd39a0add4
|
@ -130,7 +130,7 @@ static void GBVideoSoftwareRendererDrawRange(struct GBVideoRenderer* renderer, i
|
|||
}
|
||||
color_t* row = &softwareRenderer->outputBuffer[softwareRenderer->outputBufferStride * y];
|
||||
int x;
|
||||
for (x = startX; x < endX; x += 8) {
|
||||
for (x = startX; x < 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];
|
||||
|
@ -140,6 +140,9 @@ static void GBVideoSoftwareRendererDrawRange(struct GBVideoRenderer* renderer, i
|
|||
row[x + 6] = softwareRenderer->palette[softwareRenderer->row[x + 6] & 0x7F];
|
||||
row[x + 7] = softwareRenderer->palette[softwareRenderer->row[x + 7] & 0x7F];
|
||||
}
|
||||
for (; x < endX; ++x) {
|
||||
row[x] = softwareRenderer->palette[softwareRenderer->row[x] & 0x7F];
|
||||
}
|
||||
}
|
||||
|
||||
static void GBVideoSoftwareRendererFinishScanline(struct GBVideoRenderer* renderer, int y) {
|
||||
|
|
Loading…
Reference in New Issue