Hi zyx,
On Wed, 2016-05-11 at 20:51 +0000, zyx wrote:
> On Tue, 2016-05-10 at 23:11 +0000, Matthew Brincke wrote:
>> now I have de-fanged the bugfix in the patch attached, it now only
>> throws when the preprocessor symbol PODOFO_THROW_ON_UNSUPPORTED is
>> #define'd: it's not right now, it just logs an error and constructs
>> an object with an empty destination array.
>
> Hi,
> thanks for the updated patch. I've a problem that I'm unsure how to
> properly test this. I'm sorry.
the attached patch has the throw completely edited out, now no #define
would change its meaning, therefore I hope you can test it, please do
as I petitioned for the former revision.
> Bye,
> zyx
Best regards, mabri
Index: src/doc/PdfDestination.cpp
===================================================================
--- src/doc/PdfDestination.cpp (revision 1724)
+++ src/doc/PdfDestination.cpp (working copy)
@@ -159,6 +159,7 @@
if ( pObject->GetDataType() == ePdfDataType_Array )
{
m_array = pObject->GetArray();
+ m_pObject = pObject;
}
else if( pObject->GetDataType() == ePdfDataType_String )
{
@@ -178,9 +179,16 @@
m_array = pValue->GetArray();
else if( pValue->IsDictionary() )
m_array = pValue->GetDictionary().GetKey( "D" )->GetArray();
+ m_pObject = pValue;
}
-
- m_pObject = pObject;
+ else
+ {
+ PdfError::LogMessage( eLogSeverity_Error, "Unsupported object given to"
+ " PdfDestination::Init of type %s", pObject->GetDataTypeString() );
+ m_array = PdfArray(); // needed to prevent crash on method calls
+ // needed for GetObject() use w/o checking its return value for NULL
+ m_pObject = pDocument->GetObjects()->CreateObject( m_array );
+ }
}
void PdfDestination::AddToDictionary( PdfDictionary & dictionary ) const
------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users