mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-31 14:32:30 +02:00
carbon: fix for possible mem corruption on ExtTextDraw
git-svn-id: trunk@24649 -
This commit is contained in:
parent
fe226671fc
commit
3584c1d8bc
@ -1005,6 +1005,7 @@ var
|
||||
Layouts : PATSLayoutRecordArray;
|
||||
LayCount : ItemCount;
|
||||
begin
|
||||
if not Assigned(FDX) or (FDXCount=0) then Exit;
|
||||
{ if idx < FDXCount then
|
||||
begin}
|
||||
Layouts:=nil;
|
||||
@ -1016,7 +1017,7 @@ begin
|
||||
if Assigned(Layouts) and (Laycount>0) then
|
||||
begin
|
||||
ofs:=0;
|
||||
for i:=0 to Min(FDXCount, Min(LayCount, Count)) do
|
||||
for i:=0 to Min(FDXCount, Min(LayCount, Count))-1 do
|
||||
begin
|
||||
Deltas^[i] := Layouts^[i].realPos-Long2Fix(ofs);
|
||||
Layouts^[i].realPos:=Long2Fix(ofs);
|
||||
@ -1062,6 +1063,9 @@ begin
|
||||
theValue := @OverSpec;
|
||||
ATSUSetTextLayoutRefCon(FLayout, UInt32(Self));
|
||||
ATSUSetLayoutControls (FLayout, 1, @theTag, @theSize, @theValue);
|
||||
end else begin
|
||||
FDX:=nil;
|
||||
FDXCount:=0;
|
||||
end;
|
||||
|
||||
if OSError(ATSUDrawText(FLayout, kATSUFromTextBeginning, kATSUToTextEnd,
|
||||
|
Loading…
Reference in New Issue
Block a user