Commit c62e978d authored by Oliver Stieber's avatar Oliver Stieber Committed by Alexandre Julliard

Verify that the texture coordinate used in DrawStridedSlow is in range

before trying to referencing the associated data.
parent 39d6e30d
......@@ -1317,13 +1317,19 @@ static void drawStridedSlow(IWineD3DDevice *iface, Direct3DVertexStridedData *sd
if (This->stateBlock->textures[textureNo] != NULL) {
int coordIdx = This->stateBlock->textureState[textureNo][D3DTSS_TEXCOORDINDEX];
float *ptrToCoords = (float *)(sd->u.s.texCoords[coordIdx].lpData + (SkipnStrides * sd->u.s.texCoords[coordIdx].dwStride));
float *ptrToCoords = NULL;
float s = 0.0, t = 0.0, r = 0.0, q = 0.0;
if (coordIdx > 7) {
VTRACE(("tex: %d - Skip tex coords, as being system generated\n", textureNo));
continue;
} else if (sd->u.s.texCoords[coordIdx].lpData == NULL) {
} else if (coordIdx < 0) {
FIXME("tex: %d - Coord index %d is less than zero, expect a crash.\n", textureNo, coordIdx);
continue;
}
ptrToCoords = (float *)(sd->u.s.texCoords[coordIdx].lpData + (SkipnStrides * sd->u.s.texCoords[coordIdx].dwStride));
if (sd->u.s.texCoords[coordIdx].lpData == NULL) {
TRACE("tex: %d - Skipping tex coords, as no data supplied\n", textureNo);
continue;
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment