Skip to content

Refuse loading palette files with >4096 columns

The parsers for kpl and gpl files will now refuse loading a palette that has more than 4096 columns configured. GIMP will also refuse to load a gpl palette with too many columns, and will additionally open a dialog box: Reading palette file '/tmp/concept-cookie.gpl': Invalid number of columns in line 3. Using default value.

In addition, previously a single line in the GPL colors section that didn't have three or more entries (i.e. R, G, B, and optionally comments) would stop the parser and add no further colors. With this change merged, it will simply skip the given color.

Test Plan

Export any palette from krita as a gpl file, edit it with a text editor and put in a big number for the columns. Then import the palette to krita.

Formalities Checklist

  • I confirmed this builds.
  • I confirmed Krita ran and the relevant functions work.
  • I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!)
  • I made sure my commits build individually and have good descriptions as per KDE guidelines.
  • I made sure my code conforms to the standards set in the HACKING file.
  • I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.

/label Needs Review

Edited by Timo Paulssen

Merge request reports

Loading