diff options
author | Błażej Szczygieł <spaz16@wp.pl> | 2016-09-25 13:09:21 +0200 |
---|---|---|
committer | Błażej Szczygieł <spaz16@wp.pl> | 2016-09-25 13:09:23 +0200 |
commit | 7b8fe97888dc1d9586d443498281df532ec1db3a (patch) | |
tree | 71c3bcd29108306a3e88ff6c465333ddf6fbf5e7 /drivers | |
parent | 20c7b65b7e3630ada9f2e8b6b64926ec05d68c4c (diff) |
Don't crash in "_process_hdr()" if "framebuffer.luminance" is empty
If "glFramebufferTexture2D()" fails on old drivers the Vector is empty.
Don't allow to read from empty Vector (NULL pointer).
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gles2/rasterizer_gles2.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp index 56489cf4df..aeb3d9e039 100644 --- a/drivers/gles2/rasterizer_gles2.cpp +++ b/drivers/gles2/rasterizer_gles2.cpp @@ -7018,6 +7018,10 @@ void RasterizerGLES2::_process_glow_bloom() { void RasterizerGLES2::_process_hdr() { + if (framebuffer.luminance.empty()) { + return; + } + glBindFramebuffer(GL_FRAMEBUFFER, framebuffer.luminance[0].fbo); glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, framebuffer.color ); |