summaryrefslogtreecommitdiff
path: root/cogl/cogl-framebuffer.c
diff options
context:
space:
mode:
authorAdel Gadllah <adel.gadllah@gmail.com>2012-03-31 14:29:01 +0200
committerNeil Roberts <neil@linux.intel.com>2012-04-02 23:32:53 +0100
commita000189c6844b487786d3599f389fd662feaec3b (patch)
tree522b32951f9f534dcbd5ca35ae42920193dc353e /cogl/cogl-framebuffer.c
parent8af076ced1b715ca5de52041b01fb5df0b629e22 (diff)
downloadcogl-a000189c6844b487786d3599f389fd662feaec3b.tar.gz
texture: Fix error handling in get_texture_bits_via_offscreen
get_texture_bits_via_offscreen does not check the return value of cogl_framebuffer_read_pixels_into_bitmap which results into never using the fallback path texture_get_cb. cogl_framebuffer_read_pixels_into_bitmap does not check whether the framebuffer is properly allocated though; so fix that as well. https://bugzilla.gnome.org/show_bug.cgi?id=673137 Reviewed-by: Neil Roberts <neil@linux.intel.com>
Diffstat (limited to 'cogl/cogl-framebuffer.c')
-rw-r--r--cogl/cogl-framebuffer.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/cogl/cogl-framebuffer.c b/cogl/cogl-framebuffer.c
index af95cac3..dff08fff 100644
--- a/cogl/cogl-framebuffer.c
+++ b/cogl/cogl-framebuffer.c
@@ -1963,6 +1963,9 @@ cogl_framebuffer_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
_COGL_RETURN_VAL_IF_FAIL (source == COGL_READ_PIXELS_COLOR_BUFFER, FALSE);
_COGL_RETURN_VAL_IF_FAIL (cogl_is_framebuffer (framebuffer), FALSE);
+ if (!cogl_framebuffer_allocate (framebuffer, NULL))
+ return FALSE;
+
ctx = cogl_framebuffer_get_context (framebuffer);
width = cogl_bitmap_get_width (bitmap);