Просмотр исходного кода

+ Fix from Colin Western fixing overflow when writing PNG files using 16 bits per colour

git-svn-id: trunk@505 -
michael 20 лет назад
Родитель
Сommit
a568981d7f
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      fcl/image/fpwritepng.pp

+ 2 - 2
fcl/image/fpwritepng.pp

@@ -472,7 +472,7 @@ end;
 function TFPWriterPNG.ColorDataColorW(color:TFPColor) : TColorData;
 begin
   with color do
-    result := red + (green shl 16) + (blue shl 32);
+    result := red + (green shl 16) + (qword(blue) shl 32);
 end;
 
 function TFPWriterPNG.ColorDataColorAB(color:TFPColor) : TColorData;
@@ -484,7 +484,7 @@ end;
 function TFPWriterPNG.ColorDataColorAW(color:TFPColor) : TColorData;
 begin
   with color do
-    result := red + (green shl 16) + (blue shl 32) + (alpha shl 48);
+    result := red + (green shl 16) + (qword(blue) shl 32) + (qword(alpha) shl 48);
 end;
 
 { Data making routines }