diff options
-rw-r--r-- | engines/fullpipe/statics.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp index de3e1ea728..8ee3b14d0c 100644 --- a/engines/fullpipe/statics.cpp +++ b/engines/fullpipe/statics.cpp @@ -106,9 +106,14 @@ bool StepArray::gotoNextPoint() { } void StepArray::insertPoints(Common::Point **points, int pointsCount) { - if (_currPointIndex + pointsCount >= _pointsCount) + if (_currPointIndex + pointsCount >= _pointsCount) { _points = (Common::Point **)realloc(_points, sizeof(Common::Point *) * (_currPointIndex + pointsCount)); + if (!_points) { + error("Out of memory at StepArray::insertPoints()"); + } + } + _maxPointIndex = _currPointIndex + pointsCount; for (int i = 0; i < pointsCount; i++) { |