Bug 320403

Summary: Many KDE applications crash when accessing a bmp image with an alpha channel.
Product: [Applications] krita Reporter: ravnox
Component: GeneralAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED UPSTREAM    
Severity: crash CC: halla, kolAflash
Priority: NOR    
Version: 2.6.3   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Backtrace from one of the application crashing(krita)
original xcf file used to create test bmp
bmp saved with the options given in the report

Description ravnox 2013-05-29 00:17:43 UTC
Created attachment 80145 [details]
Backtrace from one of the application crashing(krita)

As the title said, many KDE applications crash when accessing a bmp image with an alpha channel. bmp images with no alpha channel seem to work fine.

Step to reproduce:

1. Open Gimp, create a new image with a transparent background. Paint hello! Export to bmp using the following Advanced Settings: A8 R8 G8 B8.

2. Try to load the file using any of the following:
- Krita
- Gwenview
- Okular

3. It should have crashed.

More information:
I first notice the bug after having installed the game Capsized from the Humble Indie Bundle. The game install its own link under the KDE Game menu. The link points to a bmp file under ~/capsized/Capsized.bmp. While trying to launch Capsized from the KDE Game menu, my desktop would crash. When trying to edit the KDE Game menu link using kmenueditor, it would crash when I would click to modify the icon(as the icon in the link points to that bmp file). Trying to see the image using Gwenview or Krita resulted in crashes. Traversing a folder with this type of bmp file will cause some other applications, such as the bug reporting tool when trying to save a report to disk, to crash as well. Trying to view the image with Gimp worked fine.

This is my first time using this bug system, the KDE tool wouldn't let me post because of missing "Kubuntu Packages" or some such. Let me know if there is anything missing. I can provide backtraces from other application than Krita since many of them crash.
Comment 1 Jekyll Wu 2013-05-29 02:47:22 UTC
> #6  0x00007fd3b6573288 in read_dib_body (s=..., bi=..., offset=138, startpos=0, image=...) at image/qbmphandler.cpp:322
> #7  0x00007fd3b657477c in QBmpHandler::read (this=0x1ef5da0, image=0x7fffced1d740) at image/qbmphandler.cpp:770
> #8  0x00007fd3b654bf0d in QImageReader::read (this=this@entry=0x7fffced1d7a0, image=image@entry=0x7fffced1d740) at image/qimagereader.cpp:1205
> #9  0x00007fd3b654c45f in QImageReader::read (this=this@entry=0x7fffced1d7a0) at image/qimagereader.cpp:1155
> #10 0x00007fd3b65409d1 in QImage::load (this=this@entry=0x7fffced1d8f0, fileName=..., format=format@entry=0x0) at image/qimage.cpp:5094
> #11 0x00007fd3b6540b95 in QImage::QImage (this=0x7fffced1d8f0, fileName=..., format=0x0) at image/qimage.cpp:995
> #12 0x00007fd37630c125 in KisBMPImport::convert (this=0x1ef5c70, from=..., to=...) at /build/buildd/calligra-2.6.3/krita/plugins/formats/bmp/kis_bmp_import.cpp:96

Probably a Qt bug. Let  Krita developers to make better judgement. 

> This is my first time using this bug system, the KDE tool wouldn't let me post because of missing "Kubuntu Packages" or some such. Let me know if there is anything missing. I can provide backtraces from other application than Krita since many of them crash.

That is a temporary issue due to some unexpected value change in bugs.kde.org.  It should work now.
Comment 2 Halla Rempt 2013-05-29 08:11:05 UTC
Looks like a Qt issue indeed, one that is fixed in Qt 4.8. I tried with Krita and Gwenview and while neither loaded the alpha channel (the background was loaded as white), there was no crash.
Comment 3 kolAflash 2013-05-29 14:33:12 UTC
Also found that bug on openSUSE 12.3 and Kubuntu 13.04 (both KDE 4.10.2) . If you need a copy of "Capsized.bmp" from "The Humble Indie Bundle 8" (https://www.humblebundle.com/) please tell me or the Humble Bundle developers.
Comment 4 Halla Rempt 2013-06-21 08:37:43 UTC
Yes, it's a Qt bug. With later updates, it at least doesn't happen for me on kubuntu 13.04 with an image as made following the original instructions. I'll attach the xcf I created and the bmp. Weirdly enough, gimp doesn' t load the transparent part of the bmp it saved.
Comment 5 Halla Rempt 2013-06-21 08:38:09 UTC
Created attachment 80679 [details]
original xcf file used to create test bmp
Comment 6 Halla Rempt 2013-06-21 08:38:31 UTC
Created attachment 80680 [details]
bmp saved with the options given in the report