Don't crash on documents with toc links that point to unexistant pages

BUGS: 112854

svn path=/branches/KDE/3.5/kdegraphics/kpdf/; revision=461852
remotes/origin/kpdf-3.5
Albert Astals Cid 21 years ago
parent 5ccc52a725
commit 810a7ecbf7
  1. 2
      core/generator_pdf/generator_pdf.cpp

@ -831,6 +831,8 @@ void PDFGenerator::fillViewportFromLink( DocumentViewport &viewport, LinkDest *d
viewport.pageNumber = pdfdoc->findPage( ref.num, ref.gen ) - 1;
}
if (viewport.pageNumber == -1) return;
// get destination position
// TODO add other attributes to the viewport (taken from link)
// switch ( destination->getKind() )

Loading…
Cancel
Save