engine.cpp: make renderSetTarget() more robust so that passing an xsiz or ysiz <= 0 is not accepted and can't cause a segmentation fault

git-svn-id: https://svn.eduke32.com/eduke32@7890 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
pogokeen 2019-08-07 16:18:57 +00:00 committed by Christoph Oelckers
parent a844fd4b13
commit 5fad944ed1

View file

@ -12004,6 +12004,9 @@ void renderSetTarget(int16_t tilenume, int32_t xsiz, int32_t ysiz)
{ {
if (setviewcnt >= MAXSETVIEW-1) if (setviewcnt >= MAXSETVIEW-1)
return; return;
if (xsiz <= 0 ||
ysiz <= 0)
return;
//DRAWROOMS TO TILE BACKUP&SET CODE //DRAWROOMS TO TILE BACKUP&SET CODE
tilesiz[tilenume].x = xsiz; tilesiz[tilenume].y = ysiz; tilesiz[tilenume].x = xsiz; tilesiz[tilenume].y = ysiz;