mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-22 20:21:26 +00:00
- validate the buffer size in HWViewpointBuffer::Set2D.
This was causing crashes in Dragon Sector when writing past the buffer's end.
This commit is contained in:
parent
70d355cfa3
commit
ec04a95929
1 changed files with 1 additions and 0 deletions
|
@ -96,6 +96,7 @@ void HWViewpointBuffer::Set2D(FRenderState &di, int width, int height, int pll)
|
||||||
matrices.mProjectionMatrix.ortho(0, (float)width, (float)height, 0, -1.0f, 1.0f);
|
matrices.mProjectionMatrix.ortho(0, (float)width, (float)height, 0, -1.0f, 1.0f);
|
||||||
matrices.CalcDependencies();
|
matrices.CalcDependencies();
|
||||||
|
|
||||||
|
CheckSize();
|
||||||
mBuffer->Map();
|
mBuffer->Map();
|
||||||
memcpy(((char*)mBuffer->Memory()) + mUploadIndex * mBlockAlign, &matrices, sizeof(matrices));
|
memcpy(((char*)mBuffer->Memory()) + mUploadIndex * mBlockAlign, &matrices, sizeof(matrices));
|
||||||
mBuffer->Unmap();
|
mBuffer->Unmap();
|
||||||
|
|
Loading…
Reference in a new issue