svx/source/tbxctrls/Palette.cxx | 3 +++ 1 file changed, 3 insertions(+)
New commits: commit cddb28b591ca8d27a7ae9bc36cdb108f4ad021ee Author: Julien Nabet <serval2...@yahoo.fr> AuthorDate: Fri Sep 1 15:56:01 2023 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Mon Sep 4 10:42:02 2023 +0200 tdf#156126: fix crash when using gpl color palette keep the do/while instead of a plain while since: 1) you'll always got a empty line since aLine isn't initialized 2) some palette may contain empty line eg: "Office 2016" palette from https://extensions.libreoffice.org/en/extensions/show/o2k10-color-palette Change-Id: I2874261b8dd13ce180ed05628b11bd3efce6720c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156421 Reviewed-by: Julien Nabet <serval2...@yahoo.fr> Tested-by: Julien Nabet <serval2...@yahoo.fr> (cherry picked from commit 46022e5fcdf01db60c0c560cbd2aff9b7a57a372) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156439 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/svx/source/tbxctrls/Palette.cxx b/svx/source/tbxctrls/Palette.cxx index 8c81eb53167e..b3f1965de31b 100644 --- a/svx/source/tbxctrls/Palette.cxx +++ b/svx/source/tbxctrls/Palette.cxx @@ -262,6 +262,9 @@ void PaletteGPL::LoadPalette() OStringBuffer aLine; do { + if (aLine.isEmpty()) + continue; + if (aLine[0] != '#' && aLine[0] != '\n') { // TODO check if r,g,b are 0<= x <=255, or just clamp?