diff options
author | Martin Robinson <mrobinson@igalia.com> | 2013-09-11 08:52:31 -0700 |
---|---|---|
committer | Martin Robinson <mrobinson@igalia.com> | 2013-09-11 08:52:31 -0700 |
commit | 7270f22af3d1ad53f033023438e915e11bf88407 (patch) | |
tree | 594467867373dfec01f5002c8f9218074c35fc7a | |
parent | 279d5a2ed1aaa6d5dbfbeab9e4b4ffa6a66aa6f3 (diff) |
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.
-rw-r--r-- | src/cairo-gl-surface.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cairo-gl-surface.c b/src/cairo-gl-surface.c index c287a01e6..b58c5365b 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); |