Просмотр исходного кода

libobs: Don't try to keep rendering if a texture wasn't allocated

Fixes issues with invalid textures causing huge output or large black
regions to be rendered.
Richard Stanway 9 лет назад
Родитель
Сommit
65094eefe4
1 измененных файлов с 3 добавлено и 0 удалено
  1. 3 0
      libobs/graphics/texture-render.c

+ 3 - 0
libobs/graphics/texture-render.c

@@ -99,6 +99,9 @@ bool gs_texrender_begin(gs_texrender_t *texrender, uint32_t cx, uint32_t cy)
 		if (!texrender_resetbuffer(texrender, cx, cy))
 		if (!texrender_resetbuffer(texrender, cx, cy))
 			return false;
 			return false;
 
 
+	if (!texrender->target)
+		return false;
+
 	gs_viewport_push();
 	gs_viewport_push();
 	gs_projection_push();
 	gs_projection_push();
 	gs_matrix_push();
 	gs_matrix_push();