[PATCH] gl: GL_UNPACK_ROW_LENGTH does not accept negative values. =

Igor Oliveira igor.o at sisa.samsung.com
Tue Mar 20 17:54:25 PDT 2012


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 =3D=3D CAIRO_GL_FLAVOR_ES &&
+       if ((ctx->gl_flavor =3D=3D CAIRO_GL_FLAVOR_ES &&
            (src->width * cpp < src->stride - 3 ||
-            width !=3D src->width))
+            width !=3D src->width)) ||
+           src->stride < 0)
        {
            glPixelStorei (GL_UNPACK_ALIGNMENT, 1);
            status =3D _cairo_gl_surface_extract_image_data (src, src_x, sr=
c_y,
-- =


More information about the cairo mailing list