- fix some crashes in the Shape2D VBO code due to unsound pointer usage (#1318)
This commit is contained in:
parent
d6987ff6b2
commit
73dc528112
3 changed files with 14 additions and 14 deletions
|
|
@ -565,7 +565,7 @@ void F2DDrawer::AddShape(FGameTexture* img, DShape2D* shape, DrawParms& parms)
|
|||
if (!shape->uploadedOnce) {
|
||||
shape->bufIndex = -1;
|
||||
shape->buffers.Clear();
|
||||
shape->lastCommand = nullptr;
|
||||
shape->lastCommand = -1;
|
||||
}
|
||||
delete shape->lastParms;
|
||||
shape->lastParms = new DrawParms(parms);
|
||||
|
|
@ -647,12 +647,9 @@ void F2DDrawer::AddShape(FGameTexture* img, DShape2D* shape, DrawParms& parms)
|
|||
shape->uploadedOnce = true;
|
||||
}
|
||||
dg.shape2DBufIndex = shape->bufIndex;
|
||||
dg.shapeLastCmd = true;
|
||||
if (shape->lastCommand != nullptr) {
|
||||
shape->lastCommand->shapeLastCmd = false;
|
||||
}
|
||||
auto c = AddCommand(&dg);
|
||||
shape->lastCommand = &mData[c];
|
||||
shape->lastCommand += 1;
|
||||
dg.shape2DCommandCounter = shape->lastCommand;
|
||||
AddCommand(&dg);
|
||||
offset = osave;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue