diff --git a/cogl/cogl-framebuffer.c b/cogl/cogl-framebuffer.c index af95cac3d..dff08fff9 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); diff --git a/cogl/cogl-texture.c b/cogl/cogl-texture.c index ab07f911c..f44970c22 100644 --- a/cogl/cogl-texture.c +++ b/cogl/cogl-texture.c @@ -965,6 +965,7 @@ get_texture_bits_via_offscreen (CoglTexture *texture, CoglOffscreen *offscreen; CoglFramebuffer *framebuffer; CoglBitmap *bitmap; + gboolean ret; _COGL_GET_CONTEXT (ctx, FALSE); @@ -986,15 +987,15 @@ get_texture_bits_via_offscreen (CoglTexture *texture, dst_format, dst_rowstride, dst_bits); - cogl_framebuffer_read_pixels_into_bitmap (framebuffer, - x, y, - COGL_READ_PIXELS_COLOR_BUFFER, - bitmap); + ret = cogl_framebuffer_read_pixels_into_bitmap (framebuffer, + x, y, + COGL_READ_PIXELS_COLOR_BUFFER, + bitmap); cogl_object_unref (bitmap); cogl_object_unref (framebuffer); - return TRUE; + return ret; } static gboolean