aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorJohannes Schickel2010-06-24 22:55:44 +0000
committerJohannes Schickel2010-06-24 22:55:44 +0000
commit1e29dc3641919ecca4589ba40df7789e6758c037 (patch)
treebfcd91ce6180bceb56fe3c716305ddee7d632ff3 /engines
parentff33acb132c3d7f15060e528c7ac4bf34321807e (diff)
downloadscummvm-rg350-1e29dc3641919ecca4589ba40df7789e6758c037.tar.gz
scummvm-rg350-1e29dc3641919ecca4589ba40df7789e6758c037.tar.bz2
scummvm-rg350-1e29dc3641919ecca4589ba40df7789e6758c037.zip
Fixed use of uninitialized variable.
svn-id: r50250
Diffstat (limited to 'engines')
-rw-r--r--engines/cine/gfx.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/engines/cine/gfx.cpp b/engines/cine/gfx.cpp
index aa0330df84..1f747c5a01 100644
--- a/engines/cine/gfx.cpp
+++ b/engines/cine/gfx.cpp
@@ -837,14 +837,11 @@ void OSRenderer::savePalette(Common::OutSaveFile &fHandle) {
*/
void OSRenderer::restorePalette(Common::SeekableReadStream &fHandle, int version) {
byte buf[kHighPalNumBytes];
- uint colorCount;
-
- if (version > 0)
- colorCount = fHandle.readUint16LE();
+ uint colorCount = (version > 0) ? fHandle.readUint16LE() : kHighPalNumBytes;
fHandle.read(buf, kHighPalNumBytes);
- if (colorCount == kHighPalNumBytes || version == 0) {
+ if (colorCount == kHighPalNumBytes) {
// Load the active 256 color palette from file
_activePal.load(buf, sizeof(buf), kHighPalFormat, kHighPalNumColors, CINE_LITTLE_ENDIAN);
} else {