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.
This commit is contained in:
Igor Oliveira 2012-03-23 16:54:22 +00:00 committed by Chris Wilson
parent 60549f7a56
commit 2121887030

View file

@ -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,