Hi I've got a couple of fixes for access violations in PDFs found in the wild:
PdfPagesTree.cpp PdfPagesTree::GetPage crashes on PDFs where the value of the "Count" key returned by GetTotalNumberOfPages is bigger than the actual number of pages in the tree. Changes: 97 Change: if( pPage->GetObject()->Reference() == ref ) To: if( pPage != NULL && pPage->GetObject()->Reference() == ref ) PdfAnnotation.cpp Out by one error in s_lNumActions (count includes terminating NULL entry, which looks wrong and faults in PdfElement::TypeNameToIndex if name isn't found). Bug fires if an annotation name doesn't match any of the annotation actions in the table. Changes: 35 Change: const long PdfAnnotation::s_lNumActions = 26; To : const long PdfAnnotation::s_lNumActions = 25; BTW The same issue affects PdfAction::s_lNumActions PdfElement.cpp PdfElement::TypeNameToIndexfaults if ppTypes[] contains sentinel NULL entries and name isn't found Changes: 98 Change: if( strcmp( pszType, ppTypes[i] ) == 0 ) To: if( ppTypes[i] != NULL && strcmp( pszType, ppTypes[i] ) == 0 ) Regards Mark Mark Rogers - mark.rog...@powermapper.com PowerMapper Software Ltd - http://www.powermapper.com Quartermile 2 Edinburgh EH3 9GL Registered in Scotland No 362274 Phone +44 845 056 8475
------------------------------------------------------------------------------
_______________________________________________ Podofo-users mailing list Podofo-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/podofo-users