summaryrefslogtreecommitdiff
path: root/tools/source/zcodec
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2016-10-07 16:29:36 +0200
committerDavid Tardon <dtardon@redhat.com>2016-10-07 19:52:16 +0200
commit18537bead90d87bc50230c746c42638125f02812 (patch)
treef4b6f2b224ab724a54c11f7fa2c757a527db18df /tools/source/zcodec
parent866eb4a7f93414932b8669d1a6afe0611655dfb4 (diff)
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
Diffstat (limited to 'tools/source/zcodec')
-rw-r--r--tools/source/zcodec/zcodec.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/source/zcodec/zcodec.cxx b/tools/source/zcodec/zcodec.cxx
index a20c0d6bfcb8..161aa33e41ad 100644
--- a/tools/source/zcodec/zcodec.cxx
+++ b/tools/source/zcodec/zcodec.cxx
@@ -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 ];
}