From 4840b889d7c8d2924f162c270d85c5431f0f86a6 Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Fri, 27 May 2016 15:25:36 -0500 Subject: SCI32: Initialise pointers in CelObj scaler This ensures that if there is a bug in the drawing code that causes the row to be unset, it will not result in silently reading garbage out of random memory. CID 1354802 --- engines/sci/graphics/celobj32.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'engines/sci/graphics/celobj32.cpp') diff --git a/engines/sci/graphics/celobj32.cpp b/engines/sci/graphics/celobj32.cpp index 3e09d0f495..da00a5e17c 100644 --- a/engines/sci/graphics/celobj32.cpp +++ b/engines/sci/graphics/celobj32.cpp @@ -120,6 +120,7 @@ struct SCALER_NoScale { const int16 _sourceY; SCALER_NoScale(const CelObj &celObj, const int16 maxWidth, const Common::Point &scaledPosition) : + _row(nullptr), _reader(celObj, FLIP ? celObj._width : maxWidth), _lastIndex(celObj._width - 1), _sourceX(scaledPosition.x), @@ -166,6 +167,7 @@ struct SCALER_Scale { static int16 _valuesY[1024]; SCALER_Scale(const CelObj &celObj, const Common::Rect &targetRect, const Common::Point &scaledPosition, const Ratio scaleX, const Ratio scaleY) : + _row(nullptr), #ifndef NDEBUG _maxX(targetRect.right - 1), #endif -- cgit v1.2.3