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).

(cherry picked from commit 7b8fe97888)
This commit is contained in:
Błażej Szczygieł 2016-09-25 13:09:21 +02:00 committed by Rémi Verschelde
parent f4f5855168
commit a827734e03
1 changed files with 4 additions and 0 deletions

View File

@ -7005,6 +7005,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 );