[cairo-commit] src/cairo-gl-surface.c

Chris Wilson ickle at kemper.freedesktop.org
Fri Mar 23 09:56:38 PDT 2012


 src/cairo-gl-surface.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 21218870300bfb4050b87c9a872b7664ce44d94e
Author: Igor Oliveira <igor.o at sisa.samsung.com>
Date:   Fri Mar 23 16:54:22 2012 +0000

    gl: GL_UNPACK_ROW_LENGTH does not accept negative values
    
    Use the slow fallback path if passed an image with a negative stride.
    
    Fixes negative-stride-image.

diff --git a/src/cairo-gl-surface.c b/src/cairo-gl-surface.c
index 95b4d7c..91c860a 100644
--- a/src/cairo-gl-surface.c
+++ b/src/cairo-gl-surface.c
@@ -845,9 +845,10 @@ _cairo_gl_surface_draw_image (cairo_gl_surface_t *dst,
 	 * b. the row stride cannot be handled by GL itself using a 4 byte
 	 *     alignment constraint
 	 */
-	if (ctx->gl_flavor == CAIRO_GL_FLAVOR_ES &&
-	    (src->width * cpp < src->stride - 3 ||
-	     width != src->width))
+	if (src->stride < 0 ||
+	    (ctx->gl_flavor == CAIRO_GL_FLAVOR_ES &&
+	     (src->width * cpp < src->stride - 3 ||
+	      width != src->width)))
 	{
 	    glPixelStorei (GL_UNPACK_ALIGNMENT, 1);
 	    status = _cairo_gl_surface_extract_image_data (src, src_x, src_y,


More information about the cairo-commit mailing list