From 19e1dcff23fd925240d40c2cf0ed555a6388d244 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 25 May 2011 16:49:09 +0100 Subject: [PATCH] framebuffer: Bail out if the viewport has negative size --- cogl/cogl-framebuffer.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cogl/cogl-framebuffer.c b/cogl/cogl-framebuffer.c index 9dc0fbc6f..efe010e4c 100644 --- a/cogl/cogl-framebuffer.c +++ b/cogl/cogl-framebuffer.c @@ -1413,6 +1413,10 @@ _cogl_framebuffer_flush_state (CoglFramebuffer *draw_buffer, { float gl_viewport_y; + if (draw_buffer->viewport_width < 0 + || draw_buffer->viewport_height < 0) + return; + /* Convert the Cogl viewport y offset to an OpenGL viewport y offset * NB: OpenGL defines its window and viewport origins to be bottom * left, while Cogl defines them to be top left.