- bail out if shape is null in F2DDrawer::AddShape

This commit is contained in:
Rachael Alexanderson 2024-09-30 02:09:52 -04:00
parent 41c69736b1
commit 0b3ee04025
No known key found for this signature in database
GPG key ID: 26A8ACCE97115EE0

View file

@ -592,6 +592,10 @@ void DShape2D::OnDestroy() {
void F2DDrawer::AddShape(FGameTexture* img, DShape2D* shape, DrawParms& parms)
{
// bail if shape is null (shouldn't happen but it might)
if (!shape)
ThrowAbortException(X_OTHER, "shape is null");
// [MK] bail out if vertex/coord array sizes are mismatched
if ( shape->mVertices.Size() != shape->mCoords.Size() )
ThrowAbortException(X_OTHER, "Mismatch in vertex/coord count: %u != %u", shape->mVertices.Size(), shape->mCoords.Size());