Bug 441356 - Corrupt png pattern in bundle causes crash
Summary: Corrupt png pattern in bundle causes crash
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Resource Management (show other bugs)
Version: 5.0.0-beta1
Platform: macOS (DMG) macOS
: NOR crash
Target Milestone: ---
Assignee: Halla Rempt
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-22 11:55 UTC by apelsinchoklad
Modified: 2021-08-23 10:00 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Bundle containing faulty png pattern file (389.98 KB, application/x-krita)
2021-08-22 11:55 UTC, apelsinchoklad
Details
faulty patterns (299.18 KB, image/png)
2021-08-22 11:57 UTC, apelsinchoklad
Details

Note You need to log in before you can comment on or make changes to this bug.
Description apelsinchoklad 2021-08-22 11:55:55 UTC
Created attachment 140942 [details]
Bundle containing faulty png pattern file

SUMMARY
Old brush bundle [2015-04-17_deevadkrita_V6.bundle] containing corrupt png pattern files causes krita to crash when selected on a brush with pattern feature turned on.
With the bundle unziped the corrupt png files wont open in krita but opens fine in GIMP.

It's also noted on David Revoys website that the bundle wont work with newer versions https://www.davidrevoy.com/article248/krita-brushes-v6

I couldn't find a working download link of the bundle so I included an attachment which only includes one of the patterns "01_canvas.png".


STEPS TO REPRODUCE
1. Import attached bundle
2. Select c)_Pencil-3_Large_4B or any other brush and turn on the pattern feature
3. From the Brush Editor select the pattern "01_canvas.png"

OBSERVED RESULT
Krita crash

SOFTWARE/OS VERSIONS
macOS: 10.13.6 High Sierra
Comment 1 apelsinchoklad 2021-08-22 11:57:32 UTC
Created attachment 140943 [details]
faulty patterns
Comment 2 Halla Rempt 2021-08-23 09:49:21 UTC
Note: this isn't a png file, but a .pat gimp pattern file.
Comment 3 Halla Rempt 2021-08-23 09:58:31 UTC
Git commit 98f6eec605642bd872b4c4ce3f42601f34226f9e by Halla Rempt.
Committed on 23/08/2021 at 09:58.
Pushed by rempt into branch 'master'.

Check whether the texturemaskinfo is valid before using it

M  +5    -0    plugins/paintops/libpaintop/KisTextureMaskInfo.cpp
M  +2    -0    plugins/paintops/libpaintop/KisTextureMaskInfo.h
M  +3    -6    plugins/paintops/libpaintop/kis_texture_option.cpp

https://invent.kde.org/graphics/krita/commit/98f6eec605642bd872b4c4ce3f42601f34226f9e
Comment 4 Halla Rempt 2021-08-23 09:58:39 UTC
Git commit 55332f5508d2d46b4375375babebd9e40242a04e by Halla Rempt.
Committed on 23/08/2021 at 09:57.
Pushed by rempt into branch 'master'.

Determine the mimetype of a pattern from its contents

Some bundles contain patterns that have a .png extension, but
are actually gimp patterns.

M  +10   -9    libs/pigment/resources/KoPattern.cpp

https://invent.kde.org/graphics/krita/commit/55332f5508d2d46b4375375babebd9e40242a04e
Comment 5 Halla Rempt 2021-08-23 09:58:41 UTC
Git commit 49842cde14e25c3952355637e9c4503a1202baa0 by Halla Rempt.
Committed on 23/08/2021 at 09:58.
Pushed by rempt into branch 'krita/5.0'.

Determine the mimetype of a pattern from its contents

Some bundles contain patterns that have a .png extension, but
are actually gimp patterns.
(cherry picked from commit 55332f5508d2d46b4375375babebd9e40242a04e)

M  +10   -9    libs/pigment/resources/KoPattern.cpp

https://invent.kde.org/graphics/krita/commit/49842cde14e25c3952355637e9c4503a1202baa0
Comment 6 Halla Rempt 2021-08-23 09:58:48 UTC
Git commit a5a8665bdfa837117a54988e3d8a72198b9bcee9 by Halla Rempt.
Committed on 23/08/2021 at 09:58.
Pushed by rempt into branch 'krita/5.0'.

Check whether the texturemaskinfo is valid before using it
(cherry picked from commit 98f6eec605642bd872b4c4ce3f42601f34226f9e)

M  +5    -0    plugins/paintops/libpaintop/KisTextureMaskInfo.cpp
M  +2    -0    plugins/paintops/libpaintop/KisTextureMaskInfo.h
M  +3    -6    plugins/paintops/libpaintop/kis_texture_option.cpp

https://invent.kde.org/graphics/krita/commit/a5a8665bdfa837117a54988e3d8a72198b9bcee9