Bug 461493 - Krita crashes on loading some TIFF files
Summary: Krita crashes on loading some TIFF files
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: File formats (show other bugs)
Version: 5.1.1
Platform: openSUSE Linux
: NOR crash
Target Milestone: ---
Assignee: amyspark
URL:
Keywords:
Depends on: 450983
Blocks:
  Show dependency treegraph
 
Reported: 2022-11-06 11:50 UTC by Tomas Mecir
Modified: 2022-11-10 02:24 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
file that causes a crash (641.79 KB, image/tiff)
2022-11-06 11:50 UTC, Tomas Mecir
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Mecir 2022-11-06 11:50:17 UTC
Created attachment 153519 [details]
file that causes a crash

Krita seems to crash when trying to open some Photoshop-generated TIFF files. A sample file is attached to this report.

[KCrash Handler]
#4  KisLayer::metaData (this=0x0) at /usr/src/debug/krita-5.1.1-1.1.x86_64/libs/image/kis_layer.cc:999
#5  0x00007f29301a103a in KisTIFFImport::convert (this=0x555a79636780, document=0x555a795d6760) at /usr/src/debug/krita-5.1.1-1.1.x86_64/plugins/impex/tiff/kis_tiff_import.cc:1854
#6  0x00007f297761e28a in KisImportExportManager::doImport (this=0x555a793d3e80, location=..., filter=...) at /usr/src/debug/krita-5.1.1-1.1.x86_64/libs/ui/KisImportExportManager.cpp:668
#7  0x00007f297761fc5d in KisImportExportManager::convert (this=0x555a793d3e80, direction=<optimized out>, location=..., realLocation=..., mimeType=..., showWarnings=<optimized out>, exportConfiguration=..., isAsync=<optimized out>, isAdvancedExporting=<optimized out>) at /usr/src/debug/krita-5.1.1-1.1.x86_64/libs/ui/KisImportExportManager.cpp:379
#8  0x00007f2977621145 in KisImportExportManager::importDocument (this=<optimized out>, location=..., mimeType=...) at /usr/src/debug/krita-5.1.1-1.1.x86_64/libs/global/kis_shared_ptr.h:206
#9  0x00007f2977608977 in KisDocument::openFile (this=0x555a795d6760) at /usr/src/debug/krita-5.1.1-1.1.x86_64/libs/ui/KisDocument.cpp:1870
#10 0x00007f29776157e9 in KisDocument::openPathInternal (this=0x555a795d6760, path=...) at /usr/src/debug/krita-5.1.1-1.1.x86_64/libs/ui/KisDocument.cpp:2410
#11 0x00007f297760f189 in KisDocument::openPath (this=0x555a795d6760, _path=..., flags=...) at /usr/src/debug/krita-5.1.1-1.1.x86_64/libs/ui/KisDocument.cpp:1806
#12 0x00007f297762c425 in KisMainWindow::openDocumentInternal (this=<optimized out>, path=..., flags=...) at /usr/src/debug/krita-5.1.1-1.1.x86_64/libs/ui/KisMainWindow.cpp:1050
#13 0x00007f297762c97e in KisMainWindow::openDocument (this=0x555a71d4f110, path=..., flags=...) at /usr/src/debug/krita-5.1.1-1.1.x86_64/libs/ui/KisMainWindow.cpp:1024
#14 0x00007f29775fbc9a in KisApplication::start (this=this@entry=0x7fff76029c50, args=...) at /usr/src/debug/krita-5.1.1-1.1.x86_64/libs/ui/KisApplication.cpp:636
#15 0x0000555a6e5e1448 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/krita-5.1.1-1.1.x86_64/krita/main.cc:715
[Inferior 1 (process 9333) detached]
Comment 1 amyspark 2022-11-10 02:16:24 UTC
Confirming, it seems Photoshop can perfectly export zero-sized resource blocks. (See "Saving Merged Transparency" in the specification, https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/).

Adding related bug whose fix caused this.
Comment 2 amyspark 2022-11-10 02:23:52 UTC
Git commit c44b3c31f725363bab7e89d465b9a1d1be64cc92 by L. E. Segovia.
Committed on 10/11/2022 at 02:23.
Pushed by lsegovia into branch 'master'.

PSD: allow zero-sized resource blocks as per the specification
Related: bug 450983

M  +1    -1    libs/psd/psd_additional_layer_info_block.cpp
M  +12   -1    plugins/impex/tiff/kis_tiff_import.cc

https://invent.kde.org/graphics/krita/commit/c44b3c31f725363bab7e89d465b9a1d1be64cc92
Comment 3 amyspark 2022-11-10 02:24:14 UTC
Git commit 29ec62a19679a94be1da9b016ae6667ea277215c by L. E. Segovia.
Committed on 10/11/2022 at 02:23.
Pushed by lsegovia into branch 'krita/5.1'.

PSD: allow zero-sized resource blocks as per the specification
Related: bug 450983
(cherry picked from commit c44b3c31f725363bab7e89d465b9a1d1be64cc92)

M  +1    -1    libs/psd/psd_additional_layer_info_block.cpp
M  +12   -1    plugins/impex/tiff/kis_tiff_import.cc

https://invent.kde.org/graphics/krita/commit/29ec62a19679a94be1da9b016ae6667ea277215c