1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-24 17:49:52 +01:00

Fix crash race condition in OpenGL renderer

This commit is contained in:
Toni Spets 2010-11-08 17:34:33 +02:00
parent 2cb9affe28
commit 7a3086a3df

View File

@ -145,11 +145,14 @@ DWORD WINAPI render_opengl_main(IDirectDrawSurfaceImpl *surface)
} }
/* convert ddraw surface to opengl texture */ /* convert ddraw surface to opengl texture */
for(i=0; i<surface->height; i++) if(surface->palette)
{ {
for(j=0; j<surface->width; j++) for(i=0; i<surface->height; i++)
{ {
tex[i*surface->width+j] = surface->palette->data_bgr[((unsigned char *)surface->surface)[i*surface->lPitch + j*surface->lXPitch]]; for(j=0; j<surface->width; j++)
{
tex[i*surface->width+j] = surface->palette->data_bgr[((unsigned char *)surface->surface)[i*surface->lPitch + j*surface->lXPitch]];
}
} }
} }