[cogl] framebuffer: Bail out if the viewport has negative size



commit 19e1dcff23fd925240d40c2cf0ed555a6388d244
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Wed May 25 16:49:09 2011 +0100

    framebuffer: Bail out if the viewport has negative size

 cogl/cogl-framebuffer.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/cogl/cogl-framebuffer.c b/cogl/cogl-framebuffer.c
index 9dc0fbc..efe010e 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.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]