mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-12-28 10:42:34 +00:00
R_DrawMaskedColumn: do not draw zero length column
- Column would be zero length if there are no visible pixels in it. - Trying to draw such a column results in a negative heightmask in R_DrawColumnTemplate and a probable read out of bounds.
This commit is contained in:
parent
9bb6031a4e
commit
d2a22a6960
1 changed files with 2 additions and 2 deletions
|
|
@ -685,7 +685,7 @@ void R_DrawMaskedColumn(drawcolumndata_t* dc, column_t *column, column_t *bright
|
|||
if (dc->yh >= baseclip && baseclip != -1)
|
||||
dc->yh = baseclip;
|
||||
|
||||
if (dc->yl <= dc->yh && dc->yh > 0)
|
||||
if (dc->yl <= dc->yh && dc->yh > 0 && column->length != 0)
|
||||
{
|
||||
dc->source = (UINT8 *)column + 3;
|
||||
dc->sourcelength = column->length;
|
||||
|
|
@ -772,7 +772,7 @@ void R_DrawFlippedMaskedColumn(drawcolumndata_t* dc, column_t *column, column_t
|
|||
if (dc->yh >= vid.height) // dc_yl must be < vid.height, so reduces number of checks in tight loop
|
||||
dc->yh = vid.height - 1;
|
||||
|
||||
if (dc->yl <= dc->yh && dc->yh > 0)
|
||||
if (dc->yl <= dc->yh && dc->yh > 0 && column->length != 0)
|
||||
{
|
||||
dc->source = static_cast<UINT8*>(ZZ_Alloc(column->length));
|
||||
dc->sourcelength = column->length;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue