From cffa23b8d0c0b2d660505a11784addb7715a9937 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Fri, 24 Feb 2017 18:14:01 +0100 Subject: fix crash in pdfimport Found by the crashreporter: http://crashreport.libreoffice.org/stats/crash_details/2eaeda85-849d-4098-b215-a8e64fe82089 Change-Id: I113f4dfc4a4f45511102c417d39fe15db6050daa Reviewed-on: https://gerrit.libreoffice.org/34628 Tested-by: Jenkins Reviewed-by: Markus Mohrhard --- sdext/source/pdfimport/tree/imagecontainer.cxx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'sdext/source') diff --git a/sdext/source/pdfimport/tree/imagecontainer.cxx b/sdext/source/pdfimport/tree/imagecontainer.cxx index 650b58446012..64d17c66ef7e 100644 --- a/sdext/source/pdfimport/tree/imagecontainer.cxx +++ b/sdext/source/pdfimport/tree/imagecontainer.cxx @@ -126,12 +126,19 @@ void ImageContainer::writeBase64EncodedStream( ImageId nId, EmitContext& rContex [] (beans::PropertyValue const& v) -> bool { return v.Name == "InputSequence"; })); - OSL_ENSURE( pValue != pAry+nLen, - "InputSequence not found" ); + + if (pValue == pAry + nLen ) + { + SAL_WARN("pdfimport", "InputSequence not found"); + return; + } uno::Sequence aData; if( !(pValue->Value >>= aData) ) - OSL_FAIL("Wrong data type"); + { + SAL_WARN("pdfimport", "Wrong data type"); + return; + } rContext.rEmitter.write( encodeBase64( aData.getConstArray(), aData.getLength() )); } -- cgit