Project .... raised exception class EAccessViolation with message 'Access violation at address 0113EBB4 in module '...'. Read of address 4A9B1ED0'.
It is because of uninitialized variable Result in the function MaxFitSafe. The value of the variable is bigger than the length of the word.
As I can see, Result should be initialized here:
Code: Select all
if (rvpaoNoWrap in pi.Options) or not Params.AllowWordWrap then
Result := MaxLen
else begin
RVU_GetTextExtentExPointPC(Params.FormatCanvas, SourceStrPtr, MaxLen,
RVConvertToFormatCanvas(SpaceTillTheEndOfLine, Params.UseFormatCanvas),
Result, nil, li.ItemOptions, sz, RVStyle.GraphicInterface);
The font Flut Saus is not only one that makes this error.
TRVWinGraphicInterface.GetTextExtentExPoint_W is a procedure so we cant check its result.
What can we do to prevent this error?