summaryrefslogtreecommitdiff
path: root/src/cairo-gl-surface.c
diff options
context:
space:
mode:
authorIgor Oliveira <igor.o@sisa.samsung.com>2012-03-23 16:54:22 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-03-23 16:54:22 +0000
commit21218870300bfb4050b87c9a872b7664ce44d94e (patch)
tree360c98224edcc1f9b40b6ffb5b463b2b3a7e3e82 /src/cairo-gl-surface.c
parent60549f7a56d2b021ab612a6b66e720d31f3400ad (diff)
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.
Diffstat (limited to 'src/cairo-gl-surface.c')
-rw-r--r--src/cairo-gl-surface.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/cairo-gl-surface.c b/src/cairo-gl-surface.c
index 95b4d7c9..91c860ac 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,