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
This commit is contained in:
13:28:23 Tim Janik 2008-09-23 11:30:35 +00:00 committed by Tim Janik
parent 014acf7565
commit 69be45d1d4
2 changed files with 7 additions and 1 deletions

View File

@ -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

View File

@ -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)
{