Infinite loop in html2thot.c

While browsing http://directory.google.com/, I found that a rather
confused attempt at HTML there that causes Amaya to lock up.  I have
attached a reduced test case.

The loop occurs in the CheckBlocksInCharElem function, where it
continually attempts to check the same structure, around a character
level element.  It appears that this happens because the same element is
put into the ToBeChecked list twice, the first time by CheckSurrounding
where it is created, and the second in XhtmlElementComplete.  Another
element is entered into the list between these calls to
BlockInCharLevelElem, preventing the duplicates check there from
working.

Now, if XhtmlElementComplete is called for all elements, then the
BlockInCharLevelElem call in CheckSurrounding can be removed, preventing
the duplicate list entry and the loop.  Unfortunately, I am not familiar
enough with the code to know if this is true.  Failing that, the check
in BlockInCharLevelElem could be extended, although this would increase
the computational complexity of the function.

  Brian Campbell

Received on Sunday, 25 August 2002 18:41:41 UTC