[PATCH] gl: GL_UNPACK_ROW_LENGTH does not accept negative values.
Igor Oliveira <[email protected]>
| Newsgroups | gmane.comp.lib.cairo |
|---|---|
| Message-ID | <73E7C25EAD45E74E8CC051AA9CA388215D3775@sj-b3k-cas1.sisa.samsung.com> |
This patch fixes the negative-stride-image test. From daf8c4b372a8f895c2c23c9f0d6f014d67c3af2c Mon Sep 17 00:00:00 2001 From: Igor Oliveira <[email protected]> Date: Tue, 20 Mar 2012 17:54:25 -0700 Subject: [PATCH] gl: GL_UNPACK_ROW_LENGTH does not accept negative values. So when we have a negative stride we should fallback for the slow code path. --- src/cairo-gl-surface.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cairo-gl-surface.c b/src/cairo-gl-surface.c index 95b4d7c..7108564 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 && + if ((ctx->gl_flavor == CAIRO_GL_FLAVOR_ES && (src->width * cpp < src->stride - 3 || - width != src->width)) + width != src->width)) || + src->stride < 0) { glPixelStorei (GL_UNPACK_ALIGNMENT, 1); status = _cairo_gl_surface_extract_image_data (src, src_x, src_y, -- -- cairo mailing list [email protected] http://lists.cairographics.org/mailman/listinfo/cairo