From 1e29dc3641919ecca4589ba40df7789e6758c037 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Thu, 24 Jun 2010 22:55:44 +0000 Subject: Fixed use of uninitialized variable. svn-id: r50250 --- engines/cine/gfx.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'engines/cine') 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 { -- cgit v1.2.3