There's a missing test for NULL in podofoimgextractor's ImageExtractor.cpp. Here's a patch to insert it; and I took the opportunity to make the logic for detecting a JPEG images slightly simpler and clearer (at least, I think it is.
--- ImageExtractor.cpp	2010-02-16 00:47:25.000000000 +1030
+++ ImageExtractor-new.cpp	2010-02-16 00:47:05.000000000 +1030
@@ -63,13 +63,10 @@
                 if( pObj && pObj->IsName() && ( pObj->GetName().GetName() == "Image" ) )
                 {
                     pObj = (*it)->GetDictionary().GetKey( PdfName::KeyFilter );
-                    if( pObj->IsName() && ( pObj->GetName().GetName() == "DCTDecode" ) )
-                    {
-                        // The only filter is JPEG -> create a JPEG file
-                        ExtractImage( *it, true );
-                    }
-                    else if( pObj->IsArray() && pObj->GetArray().GetSize() == 1 && 
+                    if( pObj && pObj->IsArray() && pObj->GetArray().GetSize() == 1 && 
                              pObj->GetArray()[0].IsName() && (pObj->GetArray()[0].GetName().GetName() == "DCTDecode") )
+                        pObj = &pObj->GetArray()[0];
+                    if( pObj && pObj->IsName() && ( pObj->GetName().GetName() == "DCTDecode" ) )
                     {
                         // The only filter is JPEG -> create a JPEG file
                         ExtractImage( *it, true );
------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to