From 6dee041a9d3eb2cc37799d346e52c0420d5e3bfd Mon Sep 17 00:00:00 2001 From: vrld Date: Wed, 7 Mar 2012 23:26:03 +0100 Subject: [PATCH] Throw exception when VBO cannot allocate enough memory in VBO::map(). --- src/modules/graphics/opengl/VertexBuffer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/modules/graphics/opengl/VertexBuffer.cpp b/src/modules/graphics/opengl/VertexBuffer.cpp index d5f969356..1bd4a73cd 100644 --- a/src/modules/graphics/opengl/VertexBuffer.cpp +++ b/src/modules/graphics/opengl/VertexBuffer.cpp @@ -129,6 +129,8 @@ namespace opengl throw love::Exception("VBO is already mapped!"); mapped = malloc(getSize()); + if (!mapped) + throw love::Exception("Out of memory (oh the humanity!)"); return mapped; }