Преглед на файлове

* Fix reading bitmap types 5,6 for PNM (fix by reporter of Bug ID #52564)

git-svn-id: trunk@26698 -
michael преди 11 години
родител
ревизия
9699890e3d
променени са 1 файла, в които са добавени 5 реда и са изтрити 1 реда
  1. 5 1
      packages/fcl-image/src/fpreadpnm.pp

+ 5 - 1
packages/fcl-image/src/fpreadpnm.pp

@@ -136,7 +136,11 @@ var
 begin
   ReadHeader(Stream);
   Img.SetSize(FWidth,FHeight);
-  FScanLineSize:=FBitPP*((FWidth+7)shr 3);
+  Case FBitmapType of
+    5,6 : FScanLineSize:=(FBitPP div 8) * FWidth;
+  else  
+    FScanLineSize:=FBitPP*((FWidth+7)shr 3);
+  end;
   GetMem(FScanLine,FScanLineSize);
   try
     for Row:=0 to img.Height-1 do