X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=backend%2Ftiff%2Ftiff-document.c;h=86170e270b7f290d728cf9ba237086d52977ca8f;hb=8c23eed0775e4a24c5224c5ac59c373924adad3d;hp=8452f79d030b90d2a8eb9ca0343adbcf9b21a636;hpb=1af6600934d1f723e5b492b8322e52a1144fb0af;p=evince.git diff --git a/backend/tiff/tiff-document.c b/backend/tiff/tiff-document.c index 8452f79d..86170e27 100644 --- a/backend/tiff/tiff-document.c +++ b/backend/tiff/tiff-document.c @@ -215,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; @@ -249,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 */