If I set TMSFNCRichEditor1.HTMLImages:=igInline;
and load html with inline images TMSFNCRichEditorHTMLIO1.Load(html);
gets error Range check error in DecodePacket
I found the reason: DecodePacket function is incorrect.
If I use the DecodePacket function included in unit Bcl.Utils it works because there's "and $FF" .
The incorrect DecodePacket function is also duplicated in other points of the library.
This is the version that works:
function DecodePacket(Idx: Integer; var nChars: Integer): TPacket;
begin
Result.a[0] := (DecodeTable[Input[Idx + 0]] shl 2) or
(DecodeTable[Input[Idx + 1]] shr 4);
NChars := 1;
if (Idx + 2 <= StrLen) and (Input[Idx + 2] <> '=') then
begin
Inc(NChars);
Result.a[1] := ((DecodeTable[Input[Idx + 1]] shl 4) or (DecodeTable[Input[Idx + 2]] shr 2)) and $FF;
end;
if (Idx + 3 <= StrLen) and (Input[Idx + 3] <> '=') then
begin
Inc(NChars);
Result.a[2] := ((DecodeTable[Input[Idx + 2]] shl 6) or DecodeTable[Input[Idx + 3]]) and $FF;
end;
end;