[poppler] [PATCH] Catalog::getNumPages(): validate page count

William Bader williambader at hotmail.com
Wed Sep 16 18:05:58 PDT 2015


> > I don't know of a good way to validate the page> > count. Even going through the page tree might be hard to do right without> > leading to an infinite loop, in addition to being slow.> > Catalog::cachePageTree goes over the tree, but i agree doing that to calculate the num of pages can be meh.

If the number of pages is huge, the PDF might be intentionally corrupted to provoke a bug in a particular PDF viewer, and other data structures could be subtly corrupted as well. Any scan would have to proceed very cautiously.

If there is a minimum number of objects required for a page, and if the total number of objects is easy to find, could poppler immediately reject files with (total num objects) / (min objects per page) < page count?

William

 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/poppler/attachments/20150916/f89b536f/attachment.html>


More information about the poppler mailing list