diff options
| author | Matthew Hoops | 2010-12-10 02:09:48 +0000 | 
|---|---|---|
| committer | Matthew Hoops | 2010-12-10 02:09:48 +0000 | 
| commit | cf65709c4570d59cf12114c36310923911d7c737 (patch) | |
| tree | ff9f97cc0196f36879059808e60e7130eb71f37b | |
| parent | 4393ef1bd5c607df678d78b56dd9c1e515dae84f (diff) | |
| download | scummvm-rg350-cf65709c4570d59cf12114c36310923911d7c737.tar.gz scummvm-rg350-cf65709c4570d59cf12114c36310923911d7c737.tar.bz2 scummvm-rg350-cf65709c4570d59cf12114c36310923911d7c737.zip  | |
VIDEO: Fix QuickTimeDecoder::hasDirtyPalette() by allocating the palette only for 8bpp videos
svn-id: r54849
| -rw-r--r-- | graphics/video/qt_decoder.cpp | 7 | ||||
| -rw-r--r-- | graphics/video/qt_decoder.h | 2 | 
2 files changed, 7 insertions, 2 deletions
diff --git a/graphics/video/qt_decoder.cpp b/graphics/video/qt_decoder.cpp index bb2714c4e5..4c7b95abf5 100644 --- a/graphics/video/qt_decoder.cpp +++ b/graphics/video/qt_decoder.cpp @@ -878,6 +878,10 @@ int QuickTimeDecoder::readSTSD(MOVatom atom) {  			// if the depth is 2, 4, or 8 bpp, file is palettized  			if (colorDepth == 2 || colorDepth == 4 || colorDepth == 8) { +				// Initialize the palette +				entry->palette = new byte[256 * 3]; +				memset(entry->palette, 0, 256 * 3); +  				if (colorGreyscale) {  					debug(0, "Greyscale palette"); @@ -1326,7 +1330,7 @@ QuickTimeDecoder::STSDEntry::STSDEntry() {  	bitsPerSample = 0;  	memset(codecName, 0, 32);  	colorTableId = 0; -	memset(palette, 0, 256 * 3); +	palette = 0;  	videoCodec = 0;  	channels = 0;  	sampleRate = 0; @@ -1335,6 +1339,7 @@ QuickTimeDecoder::STSDEntry::STSDEntry() {  }  QuickTimeDecoder::STSDEntry::~STSDEntry() { +	delete[] palette;  	delete videoCodec;  } diff --git a/graphics/video/qt_decoder.h b/graphics/video/qt_decoder.h index f1f9fd98d2..6198c2e24b 100644 --- a/graphics/video/qt_decoder.h +++ b/graphics/video/qt_decoder.h @@ -158,7 +158,7 @@ protected:  		// Video  		char codecName[32];  		uint16 colorTableId; -		byte palette[256 * 3]; +		byte *palette;  		Codec *videoCodec;  		// Audio  | 
