mORMot and Open Source friends
Check-in [2d603b6027]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:fixed a potential GPF issue in function HashOf() in PUREPASCAL mode (used to reuse any existing bitmap content within the PDF document)
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 2d603b6027ad666a7c6ebf2a77819f2907f2a70f
User & Date: G018869 2012-02-14 15:57:24
Context
2012-02-14
16:18
documentation update about caching mechanisms implemented within the framework check-in: 40db4c74b0 user: G018869 tags: trunk
15:57
fixed a potential GPF issue in function HashOf() in PUREPASCAL mode (used to reuse any existing bitmap content within the PDF document) check-in: 2d603b6027 user: G018869 tags: trunk
13:12
fixed issue in Hash32() implementation (potential GPF when reading ahead by DWORD - get rid of unnecessary asm optimization) check-in: 241337a58c user: G018869 tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to SynPdf.pas.

163
164
165
166
167
168
169


170
171
172
173
174
175
176
....
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
  - fixed issue in TPdfDocument.CreateOrGetImage about guessing if a bitmap is
    to be reused as a pdf object
  - added TPdfDocument.ForceNoBitmapReuse property
  - added a "Decimals: cardinal=6" parameter to TPdfCanvas.ConcatToCTM
  - TPdfCanvas.SetDash parameter is now an array of integer
  - set PDF_MAX_FONTSIZE limit to 2000 - should be big enough in practice
  - fixed an issue when the first time a font was used is as Unicode



}


{$I Synopse.inc} // define HASINLINE USETYPEINFO CPU32 CPU64

{$define USE_UNISCRIBE}
................................................................................

function HashOf(P: PByteArray; Len: integer): cardinal;
// algorithm from IniFiles.TStringHash.HashOf
{$ifdef PUREPASCAL}
var I: Integer;
begin
  Result := 0;
  for I := 1 to Len do
    Result := ((Result shl 2) or (Result shr (SizeOf(Result)*8-2))) xor P[I];
end;
{$else}
asm // faster asm version by Synopse
    or edx,edx
    jz @z
    push ebx






>
>







 







|







163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
....
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
  - fixed issue in TPdfDocument.CreateOrGetImage about guessing if a bitmap is
    to be reused as a pdf object
  - added TPdfDocument.ForceNoBitmapReuse property
  - added a "Decimals: cardinal=6" parameter to TPdfCanvas.ConcatToCTM
  - TPdfCanvas.SetDash parameter is now an array of integer
  - set PDF_MAX_FONTSIZE limit to 2000 - should be big enough in practice
  - fixed an issue when the first time a font was used is as Unicode
  - fixed a potential GPF issue in function HashOf() in PUREPASCAL mode (used
    to reuse any existing bitmap content within the PDF document)

}


{$I Synopse.inc} // define HASINLINE USETYPEINFO CPU32 CPU64

{$define USE_UNISCRIBE}
................................................................................

function HashOf(P: PByteArray; Len: integer): cardinal;
// algorithm from IniFiles.TStringHash.HashOf
{$ifdef PUREPASCAL}
var I: Integer;
begin
  Result := 0;
  for I := 0 to Len-1 do
    Result := ((Result shl 2) or (Result shr (SizeOf(Result)*8-2))) xor P[I];
end;
{$else}
asm // faster asm version by Synopse
    or edx,edx
    jz @z
    push ebx