fix some minor UB indications (#2178)

This commit is contained in:
Fabian Greffrath 2025-02-04 10:30:39 +01:00 committed by GitHub
parent bba0c59454
commit 73a2f72e4e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -1316,7 +1316,7 @@ spawnit:
if (mobj->flags & MF_COUNTITEM)
totalitems++;
mobj->angle = ANG45 * (mthing->angle/45);
mobj->angle = (angle_t)ANG45 * (mthing->angle/45);
if (mthing->options & MTF_AMBUSH)
mobj->flags |= MF_AMBUSH;

View File

@ -523,7 +523,7 @@ void R_StoreWallRange(const int start, const int stop)
int64_t dx, dy, dx1, dy1, dist;
const uint32_t len = curline->r_length; // [FG] use re-calculated seg lengths
if (ds_p == drawsegs+maxdrawsegs) // killough 1/98 -- fix 2s line HOM
if (!drawsegs || ds_p == drawsegs+maxdrawsegs) // killough 1/98 -- fix 2s line HOM
{
unsigned newmax = maxdrawsegs ? maxdrawsegs*2 : 128; // killough
drawsegs = Z_Realloc(drawsegs,newmax*sizeof(*drawsegs),PU_STATIC,0);