Bug 460715 - Krita crashes when opening a avif file
Summary: Krita crashes when opening a avif file
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: File formats (show other bugs)
Version: nightly build (please specify the git hash!)
Platform: Microsoft Windows Microsoft Windows
: NOR crash
Target Milestone: ---
Assignee: amyspark
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-19 15:23 UTC by thetwo
Modified: 2022-10-31 21:41 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
pic (2.35 KB, image/avif)
2022-10-19 15:23 UTC, thetwo
Details
bug (322.78 KB, text/plain)
2022-10-19 15:26 UTC, thetwo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description thetwo 2022-10-19 15:23:19 UTC
Created attachment 153032 [details]
pic

SUMMARY
krita-nightly-x64-5.2.0-prealpha-b19356bae8

This is an hdr animation file produced by krita. The author himself said that he could not open it, nor could I open it.
Comment 1 thetwo 2022-10-19 15:26:51 UTC
Created attachment 153033 [details]
bug
Comment 2 amyspark 2022-10-26 14:21:22 UTC
The crash is caused by a completely null (no primaries and no transfer curve) profile being fed into Little CMS. As this is a two-fold bug, could you please send us the KRA from which this AVIF was created?
Comment 3 amyspark 2022-10-26 21:58:04 UTC
I've managed to trace how could invalid primaries slip into an AVIF file. The fix is multifaceted, and requires hardening our color space management logic. 

See MR here: https://invent.kde.org/graphics/krita/-/merge_requests/1631
Comment 4 amyspark 2022-10-31 21:35:28 UTC
Git commit 4d5320a0cb4a58ce71fe357789e9397a3d33f920 by L. E. Segovia.
Committed on 31/10/2022 at 21:34.
Pushed by lsegovia into branch 'master'.

IccColorProfile: assert if LittleCMS returns a null cmsPROFILE

M  +11   -10   plugins/color/lcms2engine/colorprofiles/IccColorProfile.cpp

https://invent.kde.org/graphics/krita/commit/4d5320a0cb4a58ce71fe357789e9397a3d33f920
Comment 5 amyspark 2022-10-31 21:35:29 UTC
Git commit 2fb91ab4c8cdc4beec13be68084f9706d3730a49 by L. E. Segovia.
Committed on 31/10/2022 at 21:34.
Pushed by lsegovia into branch 'master'.

HEIF: consistently apply the default value for conversion policies

M  +10   -4    plugins/impex/heif/HeifExport.cpp

https://invent.kde.org/graphics/krita/commit/2fb91ab4c8cdc4beec13be68084f9706d3730a49
Comment 6 amyspark 2022-10-31 21:35:36 UTC
Git commit 83d9f9e3a140cc9f251123a4b284b277649ec663 by L. E. Segovia.
Committed on 31/10/2022 at 21:34.
Pushed by lsegovia into branch 'master'.

IccColorSpaceEngine: add a HDR fallback for scene linear profiles lacking primaries

M  +5    -1    plugins/color/lcms2engine/IccColorSpaceEngine.cpp

https://invent.kde.org/graphics/krita/commit/83d9f9e3a140cc9f251123a4b284b277649ec663
Comment 7 amyspark 2022-10-31 21:35:44 UTC
Git commit c072afb514fa89ccb77cfdc1167b37bd598d9025 by L. E. Segovia.
Committed on 31/10/2022 at 21:34.
Pushed by lsegovia into branch 'master'.

IccColorProfile: assert on invalid color space specification

M  +3    -2    plugins/color/lcms2engine/IccColorSpaceEngine.cpp
M  +5    -0    plugins/color/lcms2engine/colorprofiles/IccColorProfile.cpp

https://invent.kde.org/graphics/krita/commit/c072afb514fa89ccb77cfdc1167b37bd598d9025
Comment 8 amyspark 2022-10-31 21:35:52 UTC
Git commit 463d4a7092e44c087de35f4542a947c40a479847 by L. E. Segovia.
Committed on 31/10/2022 at 21:34.
Pushed by lsegovia into branch 'master'.

IccColorSpaceEngine: fix safe assertion with partially unspecified profiles

M  +8    -4    plugins/color/lcms2engine/IccColorSpaceEngine.cpp

https://invent.kde.org/graphics/krita/commit/463d4a7092e44c087de35f4542a947c40a479847
Comment 9 amyspark 2022-10-31 21:36:00 UTC
Git commit 321e56ed485e8758a469badac9783d98a237e658 by L. E. Segovia.
Committed on 31/10/2022 at 21:34.
Pushed by lsegovia into branch 'master'.

HEIF: properly catch attempts to store invalid CICP values

M  +32   -26   libs/ui/KisImportExportManager.cpp
M  +13   -7    plugins/impex/heif/HeifExport.cpp

https://invent.kde.org/graphics/krita/commit/321e56ed485e8758a469badac9783d98a237e658
Comment 10 amyspark 2022-10-31 21:40:35 UTC
Git commit b839f961070d18bd2b6d692deade3a27216ddbf1 by L. E. Segovia.
Committed on 31/10/2022 at 21:39.
Pushed by lsegovia into branch 'krita/5.1'.

IccColorProfile: assert on invalid color space specification
(cherry picked from commit c072afb514fa89ccb77cfdc1167b37bd598d9025)

M  +3    -2    plugins/color/lcms2engine/IccColorSpaceEngine.cpp
M  +5    -0    plugins/color/lcms2engine/colorprofiles/IccColorProfile.cpp

https://invent.kde.org/graphics/krita/commit/b839f961070d18bd2b6d692deade3a27216ddbf1
Comment 11 amyspark 2022-10-31 21:40:43 UTC
Git commit a265ff2a00d9e28c553c3b2e189e5087be23c0af by L. E. Segovia.
Committed on 31/10/2022 at 21:39.
Pushed by lsegovia into branch 'krita/5.1'.

IccColorProfile: assert if LittleCMS returns a null cmsPROFILE
(cherry picked from commit 4d5320a0cb4a58ce71fe357789e9397a3d33f920)

M  +11   -10   plugins/color/lcms2engine/colorprofiles/IccColorProfile.cpp

https://invent.kde.org/graphics/krita/commit/a265ff2a00d9e28c553c3b2e189e5087be23c0af
Comment 12 amyspark 2022-10-31 21:40:51 UTC
Git commit 33e3f9cc8f70df3222272f7916d3459f40fc17f7 by L. E. Segovia.
Committed on 31/10/2022 at 21:39.
Pushed by lsegovia into branch 'krita/5.1'.

HEIF: properly catch attempts to store invalid CICP values
(cherry picked from commit 321e56ed485e8758a469badac9783d98a237e658)

M  +32   -26   libs/ui/KisImportExportManager.cpp
M  +13   -7    plugins/impex/heif/HeifExport.cpp

https://invent.kde.org/graphics/krita/commit/33e3f9cc8f70df3222272f7916d3459f40fc17f7
Comment 13 amyspark 2022-10-31 21:40:59 UTC
Git commit 6cd3092bfd9f06482c9f3beff9ecd768f5eb5fc5 by L. E. Segovia.
Committed on 31/10/2022 at 21:39.
Pushed by lsegovia into branch 'krita/5.1'.

IccColorSpaceEngine: fix safe assertion with partially unspecified profiles
(cherry picked from commit 463d4a7092e44c087de35f4542a947c40a479847)

M  +8    -4    plugins/color/lcms2engine/IccColorSpaceEngine.cpp

https://invent.kde.org/graphics/krita/commit/6cd3092bfd9f06482c9f3beff9ecd768f5eb5fc5
Comment 14 amyspark 2022-10-31 21:41:07 UTC
Git commit 1379b98171e8123a39347c47f8935d677b8f9f44 by L. E. Segovia.
Committed on 31/10/2022 at 21:39.
Pushed by lsegovia into branch 'krita/5.1'.

IccColorSpaceEngine: add a HDR fallback for scene linear profiles lacking primaries
(cherry picked from commit 83d9f9e3a140cc9f251123a4b284b277649ec663)

M  +5    -1    plugins/color/lcms2engine/IccColorSpaceEngine.cpp

https://invent.kde.org/graphics/krita/commit/1379b98171e8123a39347c47f8935d677b8f9f44
Comment 15 amyspark 2022-10-31 21:41:16 UTC
Git commit 8f74d8491e90c3b33099dd60fd66af5dd11fb9d8 by L. E. Segovia.
Committed on 31/10/2022 at 21:39.
Pushed by lsegovia into branch 'krita/5.1'.

HEIF: consistently apply the default value for conversion policies
(cherry picked from commit 2fb91ab4c8cdc4beec13be68084f9706d3730a49)

M  +10   -4    plugins/impex/heif/HeifExport.cpp

https://invent.kde.org/graphics/krita/commit/8f74d8491e90c3b33099dd60fd66af5dd11fb9d8