diff options
author | Eugene Sandulenko | 2015-11-27 16:37:49 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2015-11-27 16:38:06 +0100 |
commit | 24dbee0f065b7165b6c18d73b9b6c564b181640b (patch) | |
tree | 135669a8070b11356981331b5d9d06a5d61c79aa | |
parent | 751183a2698398f8b25f85d189d91151be90549c (diff) | |
download | scummvm-rg350-24dbee0f065b7165b6c18d73b9b6c564b181640b.tar.gz scummvm-rg350-24dbee0f065b7165b6c18d73b9b6c564b181640b.tar.bz2 scummvm-rg350-24dbee0f065b7165b6c18d73b9b6c564b181640b.zip |
FULLPIPE: Check result on realloc()
-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++) { |