Fix potential crash on sprite draw caused by null ref

This commit is contained in:
korenkonder
2023-12-27 14:58:31 +03:00
parent 3fed0963d6
commit ef1c83da89
+3 -3
View File
@@ -1613,7 +1613,7 @@ namespace spr {
}
break;
case 1:
draw_param.texture[0] = tex_param[0].texture->tex;
draw_param.texture[0] = tex_param[0].texture ? tex_param[0].texture->tex : 0;
draw_param.sampler = rctx->sprite_samplers[0];
if (args.num_vertex) {
@@ -1756,8 +1756,8 @@ namespace spr {
return;
}
draw_param.texture[0] = tex_param[0].texture->tex;
draw_param.texture[1] = tex_param[1].texture->tex;
draw_param.texture[0] = tex_param[0].texture ? tex_param[0].texture->tex : 0;
draw_param.texture[1] = tex_param[1].texture ? tex_param[1].texture->tex : 0;
draw_param.sampler = rctx->sprite_samplers[2];
sprite_draw_vertex spr_vtx[4] = {};