summaryrefslogtreecommitdiff
path: root/tools/source/zcodec
AgeCommit message (Collapse)Author
2018-01-17Missing includes (Windows --disable-pch)Stephan Bergmann
Change-Id: I5cd3297cff31b88c53cd04232bed40cbf04fa2f6 Reviewed-on: https://gerrit.libreoffice.org/48028 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-15convert a<b?a:b to std::min(a,b)Noel Grandin
with something like git grep -nP '(.*)\s*<\s*(.*)\s*\?\s*\g1\s*:\s*\g2' -- *.?xx Change-Id: Id5078b35961847feb78a66204fdb7598ee63fd23 Note: we also convert a>b?b:a Reviewed-on: https://gerrit.libreoffice.org/47736 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-12More loplugin:cstylecast: toolsStephan Bergmann
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: Ifb9ebc9623c8df14ea0d4c907001bd16c5b9ae59
2017-12-21new loplugin: convertlongNoel Grandin
merge the droplong and convertuintptr into one new plugin. Limit the analysis to looking at var decl's, since that seems to be safest proposition, even if that too needs some careful analysis. Change-Id: Id005baaf05cfb157ce44a06a1c81f08559a07d1f Reviewed-on: https://gerrit.libreoffice.org/46851 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-13sal_uIntPtr->size_t in ZCodecNoel Grandin
to match the underlying fields Change-Id: I79ce52b80e2589b3194616b3d43846cdefd7adae Reviewed-on: https://gerrit.libreoffice.org/46349 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-22drop duplicate methodCaolán McNamara
Change-Id: Idadd0a64e41cd02f5167b275081c3576a6224b12 Reviewed-on: https://gerrit.libreoffice.org/45075 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-10-25loplugin:constmethod in tools,sax,UnoControlsNoel Grandin
Change-Id: Ie05e44e2a4019e2549843961ebfa04fef7b7aeb4 Reviewed-on: https://gerrit.libreoffice.org/43767 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-01ofz: Z_NEED_DICT is unsupportedCaolán McNamara
Change-Id: Ib0945d5a4606915aff9ee3019203caaf2a3cc7c5
2016-10-07don't call inflateEnd if inflateInit failedDavid Tardon
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
2016-07-13loplugin:constparams in toolsNoel Grandin
Change-Id: Iea05efbb90a0a95fefd18ae9673095a31422f06c Reviewed-on: https://gerrit.libreoffice.org/27137 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-27tdf#75280 Cleaning up of sal_uIntPtr usage #1atymyjan
Change-Id: Ief2cc6ab03316c2530d386d662db21ca1c9ddb30 Reviewed-on: https://gerrit.libreoffice.org/25898 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-06-06tools: rename SvStream::Read/Write to ReadBytes/WriteBytesMichael Stahl
Change-Id: Ib788a30d413436aa03f813aa2fddcbc4d6cd2f9a Reviewed-on: https://gerrit.libreoffice.org/25972 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-05-13clang-tidy modernize-loop-convert in toolkit to uuiNoel Grandin
Change-Id: I805aa1389ef8dde158f0b776d6b59579fa3082e4 Reviewed-on: https://gerrit.libreoffice.org/24921 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-03-17loplugin:constantparam in toolsNoel Grandin
Change-Id: I3774661799c074561c694515baba42a375d0a077 Reviewed-on: https://gerrit.libreoffice.org/23301 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-01-15loplugin:unusedmethods unused return value in include/toolsNoel Grandin
Change-Id: I77a6a46ca20cb41ed73050185fb2064a1bbf2009 Reviewed-on: https://gerrit.libreoffice.org/21485 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-01-07Avoid memory leaks upon (de)compression failureStephan Bergmann
This e.g. reduces the LSan-reported leakage during CppunitTest_sd_filters_test from SUMMARY: AddressSanitizer: 504104 byte(s) leaked in 4654 allocation(s). to SUMMARY: AddressSanitizer: 115048 byte(s) leaked in 4639 allocation(s). Change-Id: If922e872d9f696847face198e082144ccd5f12de
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann
Change-Id: Ia5acfb564f913d52cd25b5d64d06b5280b94cb72
2015-09-21valgrind: use of uninit data in sw_globalfilter testCaolán McNamara
Change-Id: I4d327d1e65c8ef5b9dede18ac55f1658d8e3569a
2015-07-07-1 -> Z_ERRNO for clarityCaolán McNamara
Change-Id: I29aa8531646f416a72b89f7571b757c39705c31a
2015-07-06only inflate if status from InitDecompress is goodCaolán McNamara
Change-Id: Ief207205b3f05dd0ed92a2d1d30e265cbdb914e3
2015-06-08loplugin:cstylecast: deal with remaining pointer castsStephan Bergmann
Change-Id: Iedee28da32a4333a414e06877f87851345bb4e9b
2015-04-27enhancement : tdf#90225 Cannot open compressed csv files from calcDennis Francis
Change-Id: I5098fd25f1747b49e47e360f017ee1112a242771 Reviewed-on: https://gerrit.libreoffice.org/15108 Reviewed-by: Kohei Yoshida <libreoffice@kohei.us> Tested-by: Kohei Yoshida <libreoffice@kohei.us>
2015-04-24loplugin:simplifyboolStephan Bergmann
Change-Id: Id1c743da4294b667438a2c075de4634bb2c85ff3
2015-03-28Clean up C-style casts from pointers to voidStephan Bergmann
Change-Id: Ife048a705e899870a8b1d9987b109d5c0cd80599
2015-03-26const_cast: convert some C-style casts and remove some redundant onesStephan Bergmann
Change-Id: I5493b2337dad102a4b22c6a6d646b4b0fd04e247
2014-11-11There are three positive return codes from inflateCaolán McNamara
#define Z_OK 0 #define Z_STREAM_END 1 #define Z_NEED_DICT 2 and we don't support dictionaries, so a Z_NEED_DICT return creates an infinite loop Change-Id: Iafb1da594962b3cb456a3223cc6d4122791718c5
2014-06-09loplugin: inlinesimplememberfunctionsNoel Grandin
Change-Id: I42119f656ca528286fb25d2d36c0af54b7d04a6b
2014-05-21So ZCodec::ReadAsynchron was wrong in using a persistent mpIStm after allStephan Bergmann
The fun thing is that with the (only) call-site to ReadAsynchron in PNGReaderImpl::ImplReadIDAT (vcl/source/gdi/pngread.cxx) passing in rIStm references to stack-allocated SvMemoryStream instances, mpIStm could point to an old, destroyed instance from a previous call, but which would have been located at exactly the same stack address as the currently passed in rIStm, so the wrong mpIStm->Read call would effectively behaved exactly the same as a correct rIStm.Read call. This went unnoticed "since the beginning" until AddressSanitizer's UseAfterReturn check came along... Change-Id: I7c75ed2d36a4c24c111d88eff647816bd2c5dbca
2014-05-21ZCodec::mpIStm is apparently(?) effectively only used by ReadAsynchronStephan Bergmann
...(which can be called multiple times in a row). But which actually looks wrong... Change-Id: I2e4914e6fed8ced383e430699dd462add9da8c08
2014-05-21Split ZCodec::ImplInitBuf into InitCompress, InitDecompressStephan Bergmann
Change-Id: I2714b1f1dadc74f8501203bc8b0722c56c9c5fb9
2014-05-21Add assertionStephan Bergmann
Change-Id: Ibe2f5f4ad52510247fb4134f433bba4b737d9c33
2014-05-21Replace ZCodec::mbInit with sane enumStephan Bergmann
...and document how the member functions are supposed to be called from client code. Change-Id: Ia4847945e4a361c43a0ed001e3e78e901c9abcad
2014-05-21ZCodec::UpdateCRC is privateStephan Bergmann
Change-Id: I2103f8a323d0454bdd1c779aadb99889ae1cf6e5
2014-05-21Split ZCodec::BeginCompression param into its 3 independent componentsStephan Bergmann
Change-Id: I275abafe81c8bb617c70646244b14f6cecc33854
2014-05-21Remove unnecessary ZCODEC_DEFAULT_STRATEGY macroStephan Bergmann
...and directly use zlib.h's Z_DEFAULT_STRATEGY Change-Id: Ibf528cbc32afec4d442656aa2963f50c0875d6a5
2014-05-21nMemUsage is always MAX_MEM_USAGEStephan Bergmann
...so just use zlib.h's MAX_MEM_LEVEL directly. Change-Id: I76d73f665df242bfb180b76aa7054cf8ddbe9e67
2014-05-21A single ZCodec ctor sufficesStephan Bergmann
Change-Id: Ib831b80afcdde98928a2759616810923348f65e8
2014-05-21Clean-up C-style (void) parameter listsStephan Bergmann
Change-Id: I41da8920e33dfdd0f1483ea2d7cf67111224b441
2014-04-11replace some SvStream seeking with calls to remainingSize()Michael Stahl
Change-Id: I2905e98425b9991d6138ab0adc15083d313ca445
2014-04-01coverity#708559 Uninitialized pointer fieldCaolán McNamara
Change-Id: Ic5b0d4634f223c57bb19c49cc853e8ec5582d1d1
2014-02-18GCC 4.9, LTO: libvcl uses GZCodec but it is not linked with the implementationJan Hubicka
This is not valid C++ and GCC now resolves the virtual calls and inlines destructor that leads to undefined symbols. Change-Id: I841d25bc6f994f0e73665b174994f9471597131e
2014-02-12convert SvStream::operator>> methods to ReadXXX methodsNoel Grandin
First, I updated the clang rewriter to do the conversion. Then I lightly hand-tweaked the output for the few places where the rewriter messed up, mostly when dealing with calls on "this". Change-Id: I40a6a977959cd97415c678eafc8507de8aa3b1a9 Reviewed-on: https://gerrit.libreoffice.org/7879 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2014-01-10Massage odd TODO code some moreStephan Bergmann
Change-Id: I0e4fab72a6384eab41eeb1357eaf88be876a6b52
2013-08-28Mark as constTakeshi Abe
Change-Id: If20ac542f31dd650d6d1cc22ced618f73e1ce773
2013-06-30Clean String and sal_Bool in toolsNorbert Thiebaud
Change-Id: I6a92196f33d7a5278c7dcc426112e9c56d582655 Reviewed-on: https://gerrit.libreoffice.org/4627 Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com> Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
2013-05-08zlib: remove ExternalPackage_zlibMichael Stahl
Change-Id: I5bce88b2044279a6563fd68c35f9c1ac824c8850
2013-03-27-Wunused-macrosStephan Bergmann
Change-Id: Ifaa1637122d6f9cae1e29b77ac36ca5d1f220aed
2012-08-18removed ascii-art and blank lines in tools/sourcePhilipp Riemer
Change-Id: I3f95d12a8c325c96c586253b5d9bb7dce24c0858
2012-07-11re-base on ALv2 code. Includes:Michael Meeks
Avoid some uses of non portable #!/bin/bash in shell scripts. Patch contributed by Pedro Giffuni http://svn.apache.org/viewvc?view=revision&revision=1235297 remove redundant namespace, patch contributed Mathias Bauer http://svn.apache.org/viewvc?view=revision&revision=1162610 removal of OS/2 port changes, and preferring our similiar tools/inc/tools/solar.h DLLPOSTFIX cleanup. i118595 - Removal of the use of getopt() from rscdep. Patch contributed by Andre Fische http://svn.apache.org/viewvc?view=revision&revision=1202270
2012-04-13sigh, need a 64bit zlib too on windows, revertingCaolán McNamara