Kaydet (Commit) 18537bea authored tarafından David Tardon's avatar David Tardon

don't call inflateEnd if inflateInit failed

This fixes the following valgrind message:

==12572== Conditional jump or move depends on uninitialised value(s)
==12572==    at 0x1505C89C: inflateEnd (inflate.c:1258)
==12572==    by 0xD17644D: ZCodec::EndCompression() (zcodec.cxx:106)
==12572==    by 0xD17724E: ZCodec::AttemptDecompression(SvStream&, SvStream&) (zcodec.cxx:405)
==12572==    by 0x5F17020A: PlainTextFilterDetect::detect(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>&) (filterdetect.cxx:157)
==12572==    by 0x3C3F098C: filter::config::TypeDetection::impl_askDetectService(rtl::OUString const&, utl::MediaDescriptor&) (typedetection.cxx:1040)
==12572==    by 0x3C3F0449: filter::config::TypeDetection::impl_detectTypeFlatAndDeep(utl::MediaDescriptor&, std::__debug::list<filter::config::FlatDetectionInfo, std::allocator<filter::config::FlatDetectionInfo> > const&, bool, std::__debug::vector<rtl::OUString, std::allocator<rtl::OUString> >&, rtl::OUString&) (typedetection.cxx:946)
==12572==    by 0x3C3ED6A1: filter::config::TypeDetection::queryTypeByDescriptor(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>&, unsigned char) (typedetection.cxx:427)
==12572==    by 0x49B232CF: OwnView_Impl::GetFilterNameFromExtentionAndInStream(com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory> const&, rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::io::XInputStream> const&) (ownview.cxx:219)
==12572==    by 0x49B011EB: OleEmbeddedObject::TryToConvertToOOo() (oleembed.cxx:268)
==12572==    by 0x49B03AD1: OleEmbeddedObject::doVerb(int) (oleembed.cxx:837)
==12572==    by 0x9F5C353: SfxInPlaceClient::DoVerb(long) (ipclient.cxx:946)
==12572==    by 0x402D395A: SwWrtShell::LaunchOLEObj(long) (wrtsh1.cxx:588)
==12572==

Change-Id: I51c0fbdc185897c60f6c0099b96c6ca9c25a35ba
üst 866eb4a7
......@@ -336,7 +336,6 @@ void ZCodec::InitCompress()
void ZCodec::InitDecompress(SvStream & inStream)
{
assert(meState == STATE_INIT);
meState = STATE_DECOMPRESS;
if ( mbStatus && mbGzLib )
{
sal_uInt8 n1, n2, j, nMethod, nFlags;
......@@ -388,6 +387,8 @@ void ZCodec::InitDecompress(SvStream & inStream)
{
mbStatus = ( inflateInit( PZSTREAM ) >= 0 );
}
if ( mbStatus )
meState = STATE_DECOMPRESS;
mpInBuf = new sal_uInt8[ mnInBufSize ];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment