diff --git a/src/hardware/hw_cache.c b/src/hardware/hw_cache.c index 16b6b3735..ad140c025 100644 --- a/src/hardware/hw_cache.c +++ b/src/hardware/hw_cache.c @@ -74,6 +74,9 @@ static void HWR_DrawColumnInCache(const column_t *patchcol, UINT8 *block, GLMipm (void)patchheight; // This parameter is unused + if (!mipmap) + return; + if (originPatch) // originPatch can be NULL here, unlike in the software version originy = originPatch->originy; @@ -112,11 +115,11 @@ static void HWR_DrawColumnInCache(const column_t *patchcol, UINT8 *block, GLMipm alpha = 0xFF; // Make pixel transparent if chroma keyed - if ((mipmap->flags & TF_CHROMAKEYED) && (texel == HWR_PATCHES_CHROMAKEY_COLORINDEX)) + if ((mipmap && mipmap->flags & TF_CHROMAKEYED) && (texel == HWR_PATCHES_CHROMAKEY_COLORINDEX)) alpha = 0x00; //Hurdler: 25/04/2000: now support colormap in hardware mode - if (mipmap->colormap) + if (mipmap && mipmap->colormap) texel = mipmap->colormap[texel]; // hope compiler will get this switch out of the loops (dreams...)