From 1ca2a8865f5b4174d51131dc56d045a98648c887 Mon Sep 17 00:00:00 2001 From: Alug Date: Sat, 28 Sep 2024 22:16:49 +0200 Subject: [PATCH] stop dying pls --- src/hardware/hw_cache.c | 3 +++ src/lua_hudlib_drawlist.c | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/src/hardware/hw_cache.c b/src/hardware/hw_cache.c index 9f02007d4..5b716d6bb 100644 --- a/src/hardware/hw_cache.c +++ b/src/hardware/hw_cache.c @@ -73,6 +73,9 @@ static void HWR_DrawColumnInCache(const column_t *patchcol, UINT8 *block, GLMipm (void)patchheight; // This parameter is unused + if (!mipmap || mipmap == NULL) + return; + if (originPatch) // originPatch can be NULL here, unlike in the software version originy = originPatch->originy; diff --git a/src/lua_hudlib_drawlist.c b/src/lua_hudlib_drawlist.c index 2ee9b8156..1cef45a87 100644 --- a/src/lua_hudlib_drawlist.c +++ b/src/lua_hudlib_drawlist.c @@ -632,12 +632,18 @@ void LUA_HUD_DrawList(huddrawlist_h list) switch (item->type) { case DI_Draw: + if (!item->patch || item->patch == NULL) + return; V_DrawFixedPatch(LERPS(x), LERPS(y), FRACUNIT, item->flags, item->patch, item->colormap); break; case DI_DrawScaled: + if (!item->patch || item->patch == NULL) + return; V_DrawFixedPatch(LERPS(x), LERPS(y), LERP(scale), item->flags, item->patch, item->colormap); break; case DI_DrawStretched: + if (!item->patch || item->patch == NULL) + return; V_DrawStretchyFixedPatch(LERPS(x), LERPS(y), LERP(hscale), LERP(vscale), item->flags, item->patch, item->colormap); break; case DI_DrawNum: