Created attachment 190841 [details] Sample drawing saved as PNG LibreOffice Draw 7.6.2 crashes whan I try to convert a bitmap to polygons. To replicate the bug do the following: (1) Create a drawing and export it to PNG (2) Open the PNG with LO Draw (3) Select "Convert to polygons" from the context menu Result: LO Draw crashes :-( OpenOffice Draw 4.1.14 doesn't crash.
Tested on Windows 10 and Windows 11.
Reproduced in: Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: 92e5898fa9ffa4dd8742f5f26e790563feef286e CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3 Locale: en-AU (en_AU.UTF-8); UI: en-US Calc: threaded Version: 7.6.3.1 (X86_64) / LibreOffice Community Build ID: c4af5b1259bceea6e979e6fe2435dbee7a5a87c2 CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3 Locale: en-AU (en_AU.UTF-8); UI: en-US Calc: threaded No repro in: Version: 7.5.8.2 (X86_64) / LibreOffice Community Build ID: f718d63693263970429a68f568db6046aaa9df01 CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3 Locale: en-AU (en_AU.UTF-8); UI: en-US Calc: threaded
Created attachment 190843 [details] gdb backtrace with 24.2 alpha0+ debug build on Ubuntu 20.04 Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: 3aca2d9776a871f15009a1aa70628ba3a03ee147 CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3 Locale: en-AU (en_AU.UTF-8); UI: en-US Calc: threaded
Bibisected with linux-64-7.6 repo to first bad build commit [b9559709ad7e1b0cc228ab286e0d18275bd4a82e] which points to core commit: commit a76a135c9e9bdecd38970e293e72eeeeca000d27 author Noel Grandin Tue Jan 03 20:14:21 2023 +0200 committer Noel Grandin Wed Jan 04 15:35:56 2023 +0000 flatten some vcl code Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145017 Noel, can you please have a look?
I have tested it with current master on Windows 10. Converting a bmp-image does not crash. Converting a png-image crashes in sal_uInt16 GetPaletteEntryCount() const { const BitmapBuffer* pBuffer = mpBuffer; assert(HasPalette() && "Bitmap has no palette!"); return HasPalette() ? pBuffer->maPalette.GetEntryCount() : 0; } in include/vcl/BitmapInfoAccess.hxx coming from vcllo.dll!BitmapInfoAccess::GetPaletteEntryCount() Line 110 C++ vcllo.dll!ImplVectorizer::ImplVectorize(const Bitmap & rColorBmp, GDIMetaFile & rMtf, unsigned char cReduce, const Link<__int64,void> * pProgress) Line 660 C++ vcllo.dll!Bitmap::Vectorize(GDIMetaFile & rMtf, unsigned char cReduce, const Link<__int64,void> * pProgress) Line 1499 C++
With LibrerOffice 7.6, 800x600.jpg and 800x600.bmp cause Draw to crash. OpenOffice can convert them.
Created attachment 190854 [details] 800x600.bmp BMP causes LO Draw to crash
Created attachment 190855 [details] 800x600.jpg JPG causes LO Draw to crash
Created attachment 190858 [details] bt with debug symbols On pc Debian x86-64 with master sources updated today, I got an assertion when giving a try with https://bugs.documentfoundation.org/attachment.cgi?id=190854
Noel Grandin committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/b0c68499ab36d2a1bdf6f1bc7d4cd259b99700e7 tdf#158224 Cannot convert bitmap to polygons It will be available in 24.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
I confirm I don't reproduce the assertion and everything works thanks to Noel's fix.
Noel Grandin committed a patch related to this issue. It has been pushed to "libreoffice-7-6": https://git.libreoffice.org/core/commit/335ff17176a83abec91dc925a3339e354a1aded8 tdf#158224 Cannot convert bitmap to polygons It will be available in 7.6.4. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
I confirm that the bug has been fixed. LibreOffice 24.2.0.0 alpha (22 Nov 2023 daily build for Windows)