[Scummvm-cvs-logs] SF.net SVN: scummvm:[54849] scummvm/trunk/graphics/video

mthreepwood at users.sourceforge.net mthreepwood at users.sourceforge.net
Fri Dec 10 03:09:48 CET 2010


Revision: 54849
          http://scummvm.svn.sourceforge.net/scummvm/?rev=54849&view=rev
Author:   mthreepwood
Date:     2010-12-10 02:09:48 +0000 (Fri, 10 Dec 2010)

Log Message:
-----------
VIDEO: Fix QuickTimeDecoder::hasDirtyPalette() by allocating the palette only for 8bpp videos

Modified Paths:
--------------
    scummvm/trunk/graphics/video/qt_decoder.cpp
    scummvm/trunk/graphics/video/qt_decoder.h

Modified: scummvm/trunk/graphics/video/qt_decoder.cpp
===================================================================
--- scummvm/trunk/graphics/video/qt_decoder.cpp	2010-12-09 22:02:02 UTC (rev 54848)
+++ scummvm/trunk/graphics/video/qt_decoder.cpp	2010-12-10 02:09:48 UTC (rev 54849)
@@ -878,6 +878,10 @@
 
 			// 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 @@
 	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() {
+	delete[] palette;
 	delete videoCodec;
 }
 

Modified: scummvm/trunk/graphics/video/qt_decoder.h
===================================================================
--- scummvm/trunk/graphics/video/qt_decoder.h	2010-12-09 22:02:02 UTC (rev 54848)
+++ scummvm/trunk/graphics/video/qt_decoder.h	2010-12-10 02:09:48 UTC (rev 54849)
@@ -158,7 +158,7 @@
 		// Video
 		char codecName[32];
 		uint16 colorTableId;
-		byte palette[256 * 3];
+		byte *palette;
 		Codec *videoCodec;
 
 		// Audio


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list