HTML rendering problem

after the last update of TMS VCL UI Pack, a problem occurred when rendering HTML components. Especially when compiling Win64. I analyzed the code in the AdvHTML unit and found that in the HTMLDrawEx procedure the IsBadge variable randomly sets to True, which causes the if not Invisible and not IsBadge then condition in the HTMLDrawLine subroutine on line 941 to never be met, the s variable is not modified and the while (Length(s) > 0) and not LineBreak and not ImgBreak do loop executes endlessly. After initializing the IsBadge variable to false, everything is OK. Otherwise, the program hangs, I get an Access violation message and the HTML text is not displayed.
Best regards and congratulations on your great work.

Can you please provide the HTML text that is causing this as so far, we cannot see an issue with it. IsBadge should only be set true when there is a HTML tag <BA...> in the HTML text.

It's not the HTML text that's causing the problem. Maybe it's a compiler issue, I use Delphi 11. When compiling 32 bit, the IsBadge parameter initializes with the value False and is OK, and when compiling 64 bit it initializes randomly, false or True, more often True. Example, THTMLabel control on the form, nothing more
when run on a Win32 platform in the debugger, the IsBadge parameter is False

when run on the Win64 platform, the IsBadge parameter is True

this causes the application to hang with an AccesViolation error and the THTMLabel control is not displayed.


After explicitly initializing the parameter IsBadge := False in the HTMLDrawEx function, everything is OK.
I hope I managed to illustrate the problem.

I have exactly the same problem, and I found the same solution :

  • set the local variable idBadge explicitly equal False

function HTMLDrawEx (.....)
if ADPIScale > 0 then
scale := ADPIScale
scale := GetDeviceCaps(Canvas.Handle, LOGPIXELSY) / 96;

ISbadge := False; // line 2856
Anchor := False;
Error := False;
OldFont := TFont.Create;

I use Delphi 12.1


This is what I did after diagnosing the problem.

We could reproduce this and we've applied a fix. We'll release an update with this fix.


OK. Thanks.