Pārlūkot izejas kodu

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 7b8fe97888dc1d9586d443498281df532ec1db3a)
Błażej Szczygieł 9 gadi atpakaļ
vecāks
revīzija
a827734e03
1 mainītis faili ar 4 papildinājumiem un 0 dzēšanām
  1. 4 0
      drivers/gles2/rasterizer_gles2.cpp

+ 4 - 0
drivers/gles2/rasterizer_gles2.cpp

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