From 8ba6f6ced5726a62718396fac52d5fe5857c55f9 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Wed, 24 Feb 2016 11:26:42 +0200 Subject: [PATCH] Fixed crash when spawning decal without texture See http://forum.zdoom.org/viewtopic.php?t=50977 --- src/g_shared/a_decals.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/g_shared/a_decals.cpp b/src/g_shared/a_decals.cpp index ebefcdff0..dcad93a3d 100644 --- a/src/g_shared/a_decals.cpp +++ b/src/g_shared/a_decals.cpp @@ -528,7 +528,11 @@ void DBaseDecal::Spread (const FDecalTemplate *tpl, side_t *wall, fixed_t x, fix GetWallStuff (wall, v1, ldx, ldy); rorg = Length (x - v1->x, y - v1->y); - tex = TexMan[PicNum]; + if ((tex = TexMan[PicNum]) == NULL) + { + return; + } + int dwidth = tex->GetWidth (); DecalWidth = dwidth * ScaleX;