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).
This commit is contained in:
Błażej Szczygieł 2016-09-25 13:09:21 +02:00
parent 20c7b65b7e
commit 7b8fe97888

View File

@ -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 );