Skip to content

Commit 7e0b9fa

Browse files
committed
- added valid texture image check to draw_primitive_begin_texture
1 parent ca96cee commit 7e0b9fa

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

scripts/Builders/yyPrimBuilder.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ function WebGL_draw_primitive_begin_texture_RELEASE(_kind, _tex) {
133133
// If they've managed to find a path through the code without this texture being bound...
134134
if (g_PrimTexture && !g_PrimTexture.webgl_textureid) {
135135
WebGL_BindTexture({texture: g_PrimTexture});
136+
if(WebGL_IsTextureImageValid(g_PrimTexture.webgl_textureid)) {
137+
yyError("draw_primitive_begin_texture: trying to use an invalid texture");
138+
return;
139+
}
136140
}
137141

138142
g_PrimVBuffer = new yyVBuffer(DEFAULT_VB_SIZE, g_webGL.GetVertexFormat(g_webGL.VERTEX_FORMAT_2D), false);

0 commit comments

Comments
 (0)