aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2015-11-27 16:37:49 +0100
committerEugene Sandulenko2015-11-27 16:38:06 +0100
commit24dbee0f065b7165b6c18d73b9b6c564b181640b (patch)
tree135669a8070b11356981331b5d9d06a5d61c79aa
parent751183a2698398f8b25f85d189d91151be90549c (diff)
downloadscummvm-rg350-24dbee0f065b7165b6c18d73b9b6c564b181640b.tar.gz
scummvm-rg350-24dbee0f065b7165b6c18d73b9b6c564b181640b.tar.bz2
scummvm-rg350-24dbee0f065b7165b6c18d73b9b6c564b181640b.zip
FULLPIPE: Check result on realloc()
-rw-r--r--engines/fullpipe/statics.cpp7
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++) {