diff --git a/src/html/htmlparser.cpp b/src/html/htmlparser.cpp
index cf703cc..d05817d 100644
--- a/src/html/htmlparser.cpp
+++ b/src/html/htmlparser.cpp
@@ -1808,7 +1808,10 @@ void HTMLParser::AddForgottenTags()
int i;
if( stack_len < 3 )
+ {
+ PopStack();
return;
+ }
// we have forgotten to close some tags