X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;ds=sidebyside;f=backend%2Ftiff%2Ftiff-document.c;h=86170e270b7f290d728cf9ba237086d52977ca8f;hb=0966dd9fbb4a8a60972382910c850a610bc40686;hp=d1473a17bbd3d94908305a030f91d7a4eba8e361;hpb=31e16bd8f386dc292e60489d4a17227804bdc2e6;p=evince.git diff --git a/backend/tiff/tiff-document.c b/backend/tiff/tiff-document.c index d1473a17..86170e27 100644 --- a/backend/tiff/tiff-document.c +++ b/backend/tiff/tiff-document.c @@ -22,6 +22,7 @@ #include "config.h" +#include #include #include #include @@ -214,9 +215,6 @@ tiff_document_render (EvDocument *document, gint rowstride, bytes; guchar *pixels = NULL; guchar *p; - GdkPixbuf *pixbuf; - GdkPixbuf *scaled_pixbuf; - GdkPixbuf *rotated_pixbuf; cairo_surface_t *surface; cairo_surface_t *rotated_surface; static const cairo_user_data_key_t key; @@ -248,11 +246,15 @@ tiff_document_render (EvDocument *document, if (width <= 0 || height <= 0) return NULL; +#ifdef HAVE_CAIRO_FORMAT_STRIDE_FOR_WIDTH + rowstride = cairo_format_stride_for_width (CAIRO_FORMAT_RGB24, width); +#else rowstride = width * 4; if (rowstride / 4 != width) /* overflow */ return NULL; - +#endif + bytes = height * rowstride; if (bytes / rowstride != height) /* overflow */