浏览代码

no redundant palette allocation

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@7022 8c9fc860-2736-0410-a75d-ab315db34111
eth.hunzikerp 8 年之前
父节点
当前提交
6fab39b45e
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      source/I386.Raster.Mod

+ 1 - 1
source/I386.Raster.Mod

@@ -69,7 +69,7 @@ MODULE Raster; (** non-portable *)	(* eos, TF  **)
 			used*: LONGINT;	(** number of valid entries in color table **)
 			clut: CLUTs.CLUT;	(* reverse color lookup structure *)
 			PROCEDURE &New*; BEGIN NEW(col,256); used:=256 END New; (*initialized to 256 colors; for backwards compatibility*)
-			PROCEDURE Init*(used:LONGINT); BEGIN SELF.used:=used; NEW(col,used) END Init; (*initialize to size # 256*) (*bugfix PH090122*)
+			PROCEDURE Init*(used:LONGINT); BEGIN SELF.used:=used; IF LEN(col,0)#used THEN NEW(col,used) END END Init; (*initialize to size # 256*) (*bugfix PH090122*)
 		END Palette;
 
 		(** image format **)