components/freetype/easylazfreetype.pas has
function TFreeTypeFont.GetVersionNumber: string;
var VersionStr: string;
idxStart,idxEnd: integer;
begin
VersionStr := Information[ftiVersionString];
idxStart := 1;
while (idxStart < length(VersionStr)) and not (VersionStr[idxStart] in['0'..'9']) do
inc(idxStart);
idxEnd := idxStart;
while (idxEnd+1 <= length(VersionStr)) and (VersionStr[idxEnd+1] in['0'..'9']) do inc(idxEnd);
if (idxEnd+1 <= length(VersionStr)) and (VersionStr[idxEnd+1] = '.') then inc(idxEnd);
while (idxEnd+1 <= length(VersionStr)) and (VersionStr[idxEnd+1] in['0'..'9']) do inc(idxEnd);
result := copy(VersionStr,idxStart,idxEnd-idxStart+1);
end;
The attached patch replaces the occurencies of
(idxEnd+1 <= length(VersionStr)) with
(idxEnd < length(VersionStr)).
diff --git a/components/freetype/easylazfreetype.pas b/components/freetype/easylazfreetype.pas
index 9cf56731c0..27f7151674 100644
--- a/components/freetype/easylazfreetype.pas
+++ b/components/freetype/easylazfreetype.pas
@@ -1143,9 +1143,9 @@ begin
while (idxStart < length(VersionStr)) and not (VersionStr[idxStart] in['0'..'9']) do
inc(idxStart);
idxEnd := idxStart;
- while (idxEnd+1 <= length(VersionStr)) and (VersionStr[idxEnd+1] in['0'..'9']) do inc(idxEnd);
- if (idxEnd+1 <= length(VersionStr)) and (VersionStr[idxEnd+1] = '.') then inc(idxEnd);
- while (idxEnd+1 <= length(VersionStr)) and (VersionStr[idxEnd+1] in['0'..'9']) do inc(idxEnd);
+ while (idxEnd < length(VersionStr)) and (VersionStr[idxEnd+1] in['0'..'9']) do inc(idxEnd);
+ if (idxEnd < length(VersionStr)) and (VersionStr[idxEnd+1] = '.') then inc(idxEnd);
+ while (idxEnd < length(VersionStr)) and (VersionStr[idxEnd+1] in['0'..'9']) do inc(idxEnd);
result := copy(VersionStr,idxStart,idxEnd-idxStart+1);
end;