Fix buffer overrun

This commit is contained in:
Magnus Norddahl 2016-12-05 04:05:55 +01:00
parent 659abc9451
commit 2f3a6da295

View file

@ -2316,7 +2316,11 @@ bool OpenGLSWFrameBuffer::OpenGLPal::Update()
{
buff[i] = ColorARGB(pal[i].a, pal[i - 1].r, pal[i - 1].g, pal[i - 1].b);
}
BorderColor = ColorARGB(pal[i].a, pal[i - 1].r, pal[i - 1].g, pal[i - 1].b);
if (numEntries > 1)
{
i = numEntries - 1;
BorderColor = ColorARGB(pal[i].a, pal[i - 1].r, pal[i - 1].g, pal[i - 1].b);
}
glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER);
GLint oldBinding = 0;