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 <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
This commit is contained in:
Markus Mohrhard 2017-02-24 18:14:01 +01:00
parent ece3c97ca6
commit cffa23b8d0

View file

@ -126,12 +126,19 @@ void ImageContainer::writeBase64EncodedStream( ImageId nId, EmitContext& rContex
[] (beans::PropertyValue const& v) -> bool { [] (beans::PropertyValue const& v) -> bool {
return v.Name == "InputSequence"; 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<sal_Int8> aData; uno::Sequence<sal_Int8> aData;
if( !(pValue->Value >>= 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() )); rContext.rEmitter.write( encodeBase64( aData.getConstArray(), aData.getLength() ));
} }