Protect against links pointing to after end of the document

svn path=/trunk/playground/graphics/okular/mobipocket/; revision=912501
remotes/origin/mobipocket
Jakub Stachowski 17 years ago
parent 3e468e8c89
commit 5fd1f8e484
  1. 2
      mobidocument.cpp

@ -76,6 +76,8 @@ QString MobiDocument::fixMobiMarkup(const QString& data)
QMapIterator<int,QString> it(anchorPositions);
while (it.hasNext()) {
it.next();
// link pointing outside the document
if ( (it.key()+offset) >= ret.size()) continue;
int fixedpos=outsideTag(ret, it.key()+offset);
ret.insert(fixedpos,QString("<a name=\"")+it.value()+QString("\"/>"));
offset+=12+it.value().size();

Loading…
Cancel
Save