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

Martin Robinson mrobinson at kemper.freedesktop.org
Wed Sep 11 10:07:45 PDT 2013


 src/cairo-gl-surface.c |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit 7270f22af3d1ad53f033023438e915e11bf88407
Author: Martin Robinson <mrobinson at igalia.com>
Date:   Wed Sep 11 08:52:31 2013 -0700

    gl: Extend oversize check to cairo_gl_surface_create_for_texture
    
    If a texture is too large to render to via a framebuffer, then eagerly
    fail with an error surface.

diff --git a/src/cairo-gl-surface.c b/src/cairo-gl-surface.c
index c287a01..b58c536 100644
--- a/src/cairo-gl-surface.c
+++ b/src/cairo-gl-surface.c
@@ -681,6 +681,11 @@ cairo_gl_surface_create_for_texture (cairo_device_t	*abstract_device,
     if (unlikely (status))
 	return _cairo_surface_create_in_error (status);
 
+    if (! _cairo_gl_surface_size_valid_for_context (ctx, width, height)) {
+	status = _cairo_gl_context_release (ctx, status);
+	return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_SIZE));
+    }
+
     surface = (cairo_gl_surface_t *)
 	_cairo_gl_surface_create_scratch_for_texture (ctx, content,
 						      tex, width, height);


More information about the cairo-commit mailing list