diff options
author | 13:28:23 Tim Janik <timj@imendio.com> | 2008-09-23 11:30:35 +0000 |
---|---|---|
committer | Tim Janik <timj@src.gnome.org> | 2008-09-23 11:30:35 +0000 |
commit | 69be45d1d4244eca5886b943109cfa3ecf82c413 (patch) | |
tree | 9ef83fc3841cb658a71c7e4d1230f00f891be427 /gdk-pixbuf | |
parent | 014acf7565800ca03497ec8ce607bda0f059ab20 (diff) | |
download | gtk+-69be45d1d4244eca5886b943109cfa3ecf82c413.tar.gz |
prevent RLE encoding of 1x1 pixel images, since the encoder comparison
2008-09-23 13:28:23 Tim Janik <timj@imendio.com>
* gdk-pixdata.c: prevent RLE encoding of 1x1 pixel images, since the
encoder comparison operator requires at least 2 pixels, fixes #553374:
Bug 553374 - gdk_pixdata_from_pixbuf fails for some images with use_rle set to TRUE
svn path=/trunk/; revision=21497
Diffstat (limited to 'gdk-pixbuf')
-rw-r--r-- | gdk-pixbuf/ChangeLog | 6 | ||||
-rw-r--r-- | gdk-pixbuf/gdk-pixdata.c | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog index 27f0a94f1a..fe218bf80a 100644 --- a/gdk-pixbuf/ChangeLog +++ b/gdk-pixbuf/ChangeLog @@ -1,3 +1,9 @@ +2008-09-23 13:28:23 Tim Janik <timj@imendio.com> + + * gdk-pixdata.c: prevent RLE encoding of 1x1 pixel images, since the + encoder comparison operator requires at least 2 pixels, fixes #553374: + Bug 553374 - gdk_pixdata_from_pixbuf fails for some images with use_rle set to TRUE + 2008-09-19 Matthias Clasen <mclasen@redhat.com> * gdk-pixbuf-io.c: Don't call fill_info if we've already filled diff --git a/gdk-pixbuf/gdk-pixdata.c b/gdk-pixbuf/gdk-pixdata.c index cdd07107b0..e9cdf8f850 100644 --- a/gdk-pixbuf/gdk-pixdata.c +++ b/gdk-pixbuf/gdk-pixdata.c @@ -328,8 +328,8 @@ gdk_pixdata_from_pixbuf (GdkPixdata *pixdata, height = pixbuf->height; rowstride = pixbuf->rowstride; - encoding = use_rle ? GDK_PIXDATA_ENCODING_RLE : GDK_PIXDATA_ENCODING_RAW; bpp = pixbuf->has_alpha ? 4 : 3; + encoding = use_rle && ((rowstride / bpp | height) > 1) ? GDK_PIXDATA_ENCODING_RLE : GDK_PIXDATA_ENCODING_RAW; if (encoding == GDK_PIXDATA_ENCODING_RLE) { |