From 9452e1a39fe74b56b8667b088b9674358dcb52a2 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 27 Mar 2018 00:42:00 +0300 Subject: Fix empty vector issue in modern and mobile2 opengl renderers. --- src/render/mobileopengl2graphics.cpp | 2 ++ src/render/modernopenglgraphics.cpp | 2 ++ 2 files changed, 4 insertions(+) (limited to 'src') diff --git a/src/render/mobileopengl2graphics.cpp b/src/render/mobileopengl2graphics.cpp index 028dc3b28..36f6263d1 100644 --- a/src/render/mobileopengl2graphics.cpp +++ b/src/render/mobileopengl2graphics.cpp @@ -1301,6 +1301,8 @@ void MobileOpenGL2Graphics::finalize(ImageVertexes *restrict const vert) STD_VECTOR::const_iterator ivbo; const int sz = CAST_S32(floatTexPool.size()); + if (sz == 0) + return; vbos.resize(sz); mglGenBuffers(sz, &vbos[0]); diff --git a/src/render/modernopenglgraphics.cpp b/src/render/modernopenglgraphics.cpp index c792021ef..473b8d264 100644 --- a/src/render/modernopenglgraphics.cpp +++ b/src/render/modernopenglgraphics.cpp @@ -1304,6 +1304,8 @@ void ModernOpenGLGraphics::finalize(ImageVertexes *restrict const vert) STD_VECTOR::const_iterator ivbo; const int sz = CAST_S32(intTexPool.size()); + if (sz == 0) + return; vbos.resize(sz); mglGenBuffers(sz, &vbos[0]); /* -- cgit v1.2.3-70-g09d2