diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2023-09-01 15:56:01 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-09-04 10:42:02 +0200 |
commit | cddb28b591ca8d27a7ae9bc36cdb108f4ad021ee (patch) | |
tree | 673c8aba24a2897944734760a9e4fb0b790614c7 /svx | |
parent | 8c886e86bc4b7534a0376204fdc646ce8103eedf (diff) |
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 <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
(cherry picked from commit 46022e5fcdf01db60c0c560cbd2aff9b7a57a372)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156439
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/tbxctrls/Palette.cxx | 3 |
1 files changed, 3 insertions, 0 deletions
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? |