From d19c05bbf0073033573ef428b63f37e7caa12337 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 30 Dec 2016 11:54:38 +0000 Subject: ofz#355: lsan detected leak MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Direct leak of 1296 byte(s) in 6 object(s) allocated from: #0 0x5de7a0 in __interceptor_calloc /src/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:72 #1 0xe0f2132 in hb_shape_plan_t* hb_object_create() /work/workdir/UnpackedTarball/harfbuzz/src/./hb-object-private.hh:129:24 #2 0xe0f2132 in hb_shape_plan_create /work/workdir/UnpackedTarball/harfbuzz/src/hb-shape-plan.cc:133 #3 0x85a3488 in CommonSalLayout::LayoutText(ImplLayoutArgs&) /src/libreoffice/vcl/source/gdi/CommonSalLayout.cxx:555:40 #4 0x3d97cf2 in OutputDevice::ImplLayout(rtl::OUString const&, int, int, Point const&, long, long const*, SalLayoutFlags, vcl::TextLayoutCache const*) const /src/libreoffice/vcl/source/outdev/text.cxx:1318:36 #5 0x3d990e1 in OutputDevice::GetTextArray(rtl::OUString const&, long*, int, int, vcl::TextLayoutCache const*) const /src/libreoffice/vcl/source/outdev/text.cxx:966:35 #6 0x3d98d2d in OutputDevice::GetTextWidth(rtl::OUString const&, int, int, vcl::TextLayoutCache const*) const /src/libreoffice/vcl/source/outdev/text.cxx:893:19 #7 0x485f630 in ImplFontMetricData::ImplInitTextLineSize(OutputDevice const*) /src/libreoffice/vcl/source/font/fontmetric.cxx:338:30 #8 0x3d6801e in OutputDevice::ImplNewFont() const /src/libreoffice/vcl/source/outdev/font.cxx:1095:42 #9 0x3d64d92 in OutputDevice::GetFontMetric() const /src/libreoffice/vcl/source/outdev/font.cxx:171:23 #10 0x8695053 in WinMtfFontStyle::WinMtfFontStyle(LOGFONTW&) /src/libreoffice/vcl/source/filter/wmf/winmtf.cxx:265:36 #11 0x8686b9b in std::__1::unique_ptr > o3tl::make_unique(LOGFONTW&) /src/libreoffice/include/o3tl/make_unique.hxx:27:35 #12 0x86eb23c in WMFReader::ReadRecordParams(unsigned short) /src/libreoffice/vcl/source/filter/wmf/winwmf.cxx:937:32 #13 0x86fb901 in WMFReader::ReadWMF() /src/libreoffice/vcl/source/filter/wmf/winwmf.cxx:1371:25 #14 0x47c5949 in ReadWindowMetafile(SvStream&, GDIMetaFile&) /src/libreoffice/vcl/source/filter/wmf/wmf.cxx:78:45 #15 0x61c7ac in LLVMFuzzerTestOneInput /src/libreoffice/vcl/workben/wmffuzzer.cxx:98:11 #16 0x1011f7e8 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/libfuzzer/FuzzerLoop.cpp:541:13 #17 0x10120544 in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long) /src/libfuzzer/FuzzerLoop.cpp:492:3 #18 0x1013ecca in fuzzer::Fuzzer::RunOne(std::__1::vector > const&) /src/libfuzzer/FuzzerInternal.h:118:41 #19 0x1011ee3d in fuzzer::Fuzzer::ShuffleAndMinimize(std::__1::vector >, std::__1::allocator > > >*) /src/libfuzzer/FuzzerLoop.cpp:471:30 #20 0x100d0aea in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/libfuzzer/FuzzerDriver.cpp:533:6 #21 0x100c38c8 in main /src/libfuzzer/FuzzerMain.cpp:20:10 #22 0x7fef8459582f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f) Change-Id: Iaa23f8282a45b7c584410b5e8c7b6e9774a34aaf Reviewed-on: https://gerrit.libreoffice.org/32508 Reviewed-by: Khaled Hosny Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- vcl/source/gdi/CommonSalLayout.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx index 75b028056368..2dd9925abd72 100644 --- a/vcl/source/gdi/CommonSalLayout.cxx +++ b/vcl/source/gdi/CommonSalLayout.cxx @@ -558,6 +558,7 @@ bool CommonSalLayout::LayoutText(ImplLayoutArgs& rArgs) (void) ok; hb_buffer_set_content_type(pHbBuffer, HB_BUFFER_CONTENT_TYPE_GLYPHS); SAL_INFO("vcl.harfbuzz", hb_shape_plan_get_shaper(pHbPlan) << " shaper used for " << mrFontSelData.GetFamilyName()); + hb_shape_plan_destroy(pHbPlan); int nRunGlyphCount = hb_buffer_get_length(pHbBuffer); hb_glyph_info_t *pHbGlyphInfos = hb_buffer_get_glyph_infos(pHbBuffer, nullptr); -- cgit v1.2.3