svx/source/tbxctrls/Palette.cxx |    3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 2ee60cb3535937eb85b808977a020b55a7123a92
Author:     Julien Nabet <serval2...@yahoo.fr>
AuthorDate: Fri Sep 1 15:56:01 2023 +0200
Commit:     Julien Nabet <serval2...@yahoo.fr>
CommitDate: Sat Sep 2 08:59:35 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>

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?

Reply via email to