Bug 3322 - claws-mail crashes when clicking on malformed PNG attachment
Summary: claws-mail crashes when clicking on malformed PNG attachment
Status: RESOLVED INVALID
Alias: None
Product: Claws Mail (GTK 2)
Classification: Unclassified
Component: UI/Message View (show other bugs)
Version: other
Hardware: PC Linux
: P3 normal
Assignee: users
URL:
Depends on:
Blocks:
 
Reported: 2014-11-07 11:15 UTC by Hanno Boeck
Modified: 2014-11-07 15:48 UTC (History)
0 users

See Also:


Attachments
malformed png file (3.63 KB, image/png)
2014-11-07 11:16 UTC, Hanno Boeck
no flags Details

Description Hanno Boeck 2014-11-07 11:15:50 UTC
When I open a mail with a malformed PNG attached it will crash claws-mail. This is what the console output says:
(claws-mail:11865): Claws-Mail-WARNING **: Failed to load image '/home/hanno/.claws-mail/mimetmp/00000007.2670-sample.png': Fatal error in PNG image file: Read Error


(claws-mail:11865): Claws-Mail-WARNING **: Can't load the image.
**
GdkPixbuf:ERROR:/var/tmp/portage/x11-libs/gdk-pixbuf-2.30.8/work/gdk-pixbuf-2.30.8/gdk-pixbuf/gdk-pixbuf-animation.c:250:gdk_pixbuf_animation_new_from_file: assertion failed: (animation)


Looks to me as first claws detects that the PNG has errors, however it will still try to open it via gdk-pixbuf and there the crash happens.

Steps to reproduce:
* Take attached PNG image, send a mail to yourself with file attached
* Open mail, click on PNG attachment
Comment 1 Hanno Boeck 2014-11-07 11:16:11 UTC
Created attachment 1447 [details]
malformed png file
Comment 2 Michael Schwendt 2014-11-07 12:26:04 UTC
> gdk_pixbuf_animation_new_from_file: assertion failed: (animation)

    animation = gdk_pixbuf_animation_new_from_file(imgfile, &error);

gdk-pixbuf should not crash upon trying to detect the file contents. The two args given to gdk_pixbuf_animation_new_from_file() are still valid, especially the "imgfile" file name ptr, and it crashes later in an assertion:

gdk-pixbuf-animation.c
   247  
   248                  if (success) {
   249                          /* If there was no error, there must be an anima
tion that was successfully loaded */
   250                          g_assert (animation);
   251                  } else {
   252                          if (animation) {
Comment 3 Hanno Boeck 2014-11-07 12:32:47 UTC
maybe this is this?
https://bugzilla.gnome.org/show_bug.cgi?id=695228

Seems a fix was committed over a year ago but it wasn't backported to the stable release.
Comment 4 Hanno Boeck 2014-11-07 12:36:27 UTC
Sorry, I was wrong. The upstream fix seems to be applied already on my version, so this is probably another issue. Will try to create a small testcase.
Comment 5 Paul 2014-11-07 15:26:42 UTC
closing this, as its not a Claws Mail bug.
Comment 6 Hanno Boeck 2014-11-07 15:48:25 UTC
FYI, reported to gdk-pixbuf upstream:
https://bugzilla.gnome.org/show_bug.cgi?id=739785

Note You need to log in before you can comment on or make changes to this bug.