summaryrefslogtreecommitdiff
path: root/gdk-pixbuf
diff options
context:
space:
mode:
author13:28:23 Tim Janik <timj@imendio.com>2008-09-23 11:30:35 +0000
committerTim Janik <timj@src.gnome.org>2008-09-23 11:30:35 +0000
commit69be45d1d4244eca5886b943109cfa3ecf82c413 (patch)
tree9ef83fc3841cb658a71c7e4d1230f00f891be427 /gdk-pixbuf
parent014acf7565800ca03497ec8ce607bda0f059ab20 (diff)
downloadgdk-pixbuf-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/ChangeLog6
-rw-r--r--gdk-pixbuf/gdk-pixdata.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog
index 27f0a94f1..fe218bf80 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 cdd07107b..e9cdf8f85 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)
{