]> www.fi.muni.cz Git - evince.git/blobdiff - backend/tiff/tiff-document.c
Use the new cairo function cairo_format_stride_for_width when available.
[evince.git] / backend / tiff / tiff-document.c
index d8bee9e529c0654d105011669dee450f59cf64c9..86170e270b7f290d728cf9ba237086d52977ca8f 100644 (file)
@@ -246,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 */