summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2023-09-01 15:56:01 +0200
committerJulien Nabet <serval2412@yahoo.fr>2023-09-02 08:59:35 +0200
commit2ee60cb3535937eb85b808977a020b55a7123a92 (patch)
tree777b7945331bc69a934d5c811085e2aa463ae6a3 /svx
parent16af9e81863a80116f808ee3cfa4a1bab7c67ac5 (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>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/tbxctrls/Palette.cxx3
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?