فهرست منبع

--- Merging r22122 into '.':
U packages/fcl-image/src/fpreadtiff.pas
--- Merging r22141 into '.':
U packages/fcl-image/src/fpreadpng.pp
--- Merging r22238 into '.':
G packages/fcl-image/src/fpreadtiff.pas
--- Merging r22256 into '.':
G packages/fcl-image/src/fpreadtiff.pas
--- Merging r22259 into '.':
G packages/fcl-image/src/fpreadtiff.pas

# revisions: 22122,22141,22238,22256,22259
r22122 | jonas | 2012-08-19 11:44:56 +0200 (Sun, 19 Aug 2012) | 2 lines
Changed paths:
M /trunk/packages/fcl-image/src/fpreadtiff.pas

* fixed missing pointer dereference of parameter passed to move()
(patch by ocean, mantis #22670)
r22141 | michael | 2012-08-20 00:22:01 +0200 (Mon, 20 Aug 2012) | 1 line
Changed paths:
M /trunk/packages/fcl-image/src/fpreadpng.pp

* Fix for 16-bit PNGs (bug 19209)
r22238 | mattias | 2012-08-25 11:18:10 +0200 (Sat, 25 Aug 2012) | 1 line
Changed paths:
M /trunk/packages/fcl-image/src/fpreadtiff.pas

fpreadtiff: fixed checking for code 4096 before add instead of after last add, bug #22558
r22256 | mattias | 2012-08-27 18:54:43 +0200 (Mon, 27 Aug 2012) | 1 line
Changed paths:
M /trunk/packages/fcl-image/src/fpreadtiff.pas

fpreadtiff: fixed reading last byte of chunk
r22259 | mattias | 2012-08-27 22:16:38 +0200 (Mon, 27 Aug 2012) | 1 line
Changed paths:
M /trunk/packages/fcl-image/src/fpreadtiff.pas

fpreadtiff: undo wrong fix

git-svn-id: branches/fixes_2_6@22537 -

marco 13 سال پیش
والد
کامیت
7b30fbfb2a
2فایلهای تغییر یافته به همراه12 افزوده شده و 12 حذف شده
  1. 9 10
      packages/fcl-image/src/fpreadpng.pp
  2. 3 2
      packages/fcl-image/src/fpreadtiff.pas

+ 9 - 10
packages/fcl-image/src/fpreadpng.pp

@@ -404,22 +404,21 @@ function TFPReaderPNG.CalcColor: TColorData;
 var cd : longword;
     r : word;
     b : byte;
+    tmp : pbytearray;
 begin
   if UsingBitGroup = 0 then
     begin
     Databytes := 0;
     if Header.BitDepth = 16 then
       begin
-      r := 1;
-      while (r < ByteWidth) do
-        begin
-        b := FCurrentLine^[Dataindex+r];
-        FCurrentLine^[Dataindex+r] := FCurrentLine^[Dataindex+r-1];
-        FCurrentLine^[Dataindex+r-1] := b;
-        inc (r,2);
-        end;
-      end;
-    move (FCurrentLine^[DataIndex], Databytes, bytewidth);
+       getmem(tmp, bytewidth);
+       fillchar(tmp^, bytewidth, 0);
+       for r:=0 to bytewidth-2 do
+        tmp^[r+1]:=FCurrentLine^[Dataindex+r];
+       move (tmp^[0], Databytes, bytewidth);
+       freemem(tmp);
+      end
+    else move (FCurrentLine^[DataIndex], Databytes, bytewidth);
     {$IFDEF ENDIAN_BIG}
     Databytes:=swap(Databytes);
     {$ENDIF}

+ 3 - 2
packages/fcl-image/src/fpreadtiff.pas

@@ -2040,7 +2040,7 @@ begin
         i:=n+1;
         inc(NewCount,i);
         inc(p);
-        System.Move(p,d^,i);
+        System.Move(p^,d^,i);
         inc(p,i);
         inc(d,i);
       end;
@@ -2181,6 +2181,8 @@ var
     p: PByte;
   begin
     //WriteLn('AddStringToTable Code=',Code,' FCFCode=',AddFirstCharFromCode,' TableCount=',TableCount,' TableCapacity=',TableCapacity);
+    if TableCount=4096-259 then
+      Error('LZW too many codes');
     // grow table
     if TableCount>=TableCapacity then begin
       TableCapacity:=TableCapacity*2+128;
@@ -2223,7 +2225,6 @@ var
     inc(TableCount);
     case TableCount+259 of
     512,1024,2048: inc(CurBitLength);
-    4096: Error('LZW too many codes');
     end;
   end;