Recent

Author Topic: [SOLVED] function TFreeTypeStream.ForgetFrame always returns Failure  (Read 412 times)

lagprogramming

  • Sr. Member
  • ****
  • Posts: 406
components/freetype/ttfile.pas contains the following function:

Code: Pascal  [Select][+][-]
  1.  function TFreeTypeStream.ForgetFrame : TError;
  2.  begin
  3.    result := Failure;
  4.  
  5.    if FCurrentFrame = nil then exit;
  6.  
  7.    if FFrameSize > frame_cache_size then
  8.      FreeMem( FCurrentFrame, FFrameSize );
  9.  
  10.    FFrameSize    := 0;
  11.    FCurrentFrame := nil;
  12.    FFrameCursor  := 0;
  13.  end;

As can be seen, it always returns failure. The following patch mimics the result assignment found in function TFreeTypeStream.AccessFrame( aSize : Int ) : TError; and in function TFreeTypeStream.ReadAtFile(APos: Long; var ABuff; ACount: Int): TError;

Code: Pascal  [Select][+][-]
  1. diff --git a/components/freetype/ttfile.pas b/components/freetype/ttfile.pas
  2. index 88fb5ff995..96a87bd590 100644
  3. --- a/components/freetype/ttfile.pas
  4. +++ b/components/freetype/ttfile.pas
  5. @@ -495,6 +495,8 @@ const
  6.     FFrameSize    := 0;
  7.     FCurrentFrame := nil;
  8.     FFrameCursor  := 0;
  9. +
  10. +   result := Success;
  11.   end;

 (*******************************************************************
« Last Edit: March 30, 2023, 06:19:58 pm by lagprogramming »

wp

  • Hero Member
  • *****
  • Posts: 11923
Re: function TFreeTypeStream.ForgetFrame always returns Failure
« Reply #1 on: March 30, 2023, 01:40:59 pm »
Committed.

But, please, post such bugs in the future in the bugtracker. Your report gets lost in the forum too easily.

 

TinyPortal © 2005-2018