more squashes things

Fix buffer overflow in SV_SendPlayerInfo

Pass -fwrapv to GCC compilation flags https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2195

Fix /unlist request https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2294

fix some alpha wrapping for translucent fofs
This commit is contained in:
Alug committed 2024-03-24 17:18:31 +01:00
1 parent b23eb166eb
commit b5bac690c0
7 files changed
+582 -588

No files matched your search

+573 -570
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -1617,7 +1617,7 @@ static void SV_SendPlayerInfo(INT32 node)
continue;
}
if (!playeringame[i])
if (playeringame[i] == UINT8_MAX || !playeringame[i])
{
netbuffer->u.playerinfo[i].node = 255; // This slot is empty.
continue;
+2 -3
View File
@@ -1298,9 +1298,9 @@ void CURLPrepareFile(const char* url, int dfilenum)
curl_multi_perform(multi_handle, &curl_runninghandles);
curl_starttime = time(NULL);
curl_running = true;
I_spawn_thread("http-download", (I_thread_fn)CURLGetFile, NULL);
}
}
@@ -1385,7 +1385,6 @@ void CURLGetFile(void)
}
}
Z_Free(filename);
curl_curfile->file = NULL;
curl_transfers--;
+2 -2
View File
@@ -2248,7 +2248,7 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
if (rover->flags & FF_TRANSLUCENT && rover->alpha < 256)
{
blendmode = PF_Translucent;
Surf.PolyColor.s.alpha = (UINT8)rover->alpha-1 > 255 ? 255 : rover->alpha-1;
Surf.PolyColor.s.alpha = max(0, min(rover->alpha, 255));
}
if (gr_frontsector->numlights)
@@ -2607,7 +2607,7 @@ static void HWR_AddLine(seg_t *line)
}
// PrBoom: Back side, i.e. backface culling - read: endAngle >= startAngle!
if (angle2 - angle1 < ANGLE_180)
if (angle2 - angle1 < ANGLE_180 || !gr_curline->linedef)
return;
// PrBoom: use REAL clipping math YAYYYYYYY!!!
+2 -1
View File
@@ -339,7 +339,8 @@ HMS_unlist (void)
if (! hms)
return 0;
curl_easy_setopt(hms->curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hms->curl, CURLOPT_POST, 1);
curl_easy_setopt(hms->curl, CURLOPT_POSTFIELDSIZE, 0);
ok = HMS_do(hms);
HMS_end(hms);
+2 -2
View File
@@ -3110,7 +3110,6 @@ static void K_StretchPlayerGravity(player_t *p)
//CONS_Printf(M_GetText("div: %d, scale factor: %d, stretch value: %d\n"), rzsDiv, stretchScaleFactor, cv_gravstretch.value);
I_Assert(p != NULL);
I_Assert(p->mo != NULL);
I_Assert(!P_MobjWasRemoved(p->mo));
@@ -3150,6 +3149,7 @@ static void K_StretchPlayerGravity(player_t *p)
slamDiv = 0;
else
slamDiv = FixedDiv(p->mo->stretchslam, stretchScaleFactor);
p->mo->spritexscale = (dxs+(((slamDiv*2)/3)*2));
p->mo->spriteyscale = (dys-(slamDiv));
if (p->mo->stretchslam > 0)
@@ -6933,7 +6933,6 @@ static patch_t *skp_smallstickerclr3;
static patch_t *kp_itemmulstickerclr[2];
static patch_t *kp_itembgclr[4];
//Kartz speedo
static patch_t *kp_kartzspeedo[25];
@@ -7086,6 +7085,7 @@ void K_LoadKartHUDGraphics(void)
kp_itembgclr[3] = W_CachePatchName("K_ISBCD", PU_HUDGFX);
kp_itemmulstickerclr[1] = W_CachePatchName("K_ISMULC", PU_HUDGFX);
kp_itemmulstickerclr[0] = W_CachePatchName("K_ITMULC", PU_HUDGFX);
if (big_lap_color){
kp_lapstickerbigclr = W_CachePatchName("K_SCLAPB", PU_HUDGFX);
kp_lapstickerbig2clr = W_CachePatchName("K_SCLA2B", PU_HUDGFX);
-9
View File
@@ -38,7 +38,6 @@ static INT32 gif_frames = 0;
static UINT8 gif_writeover = 0;
// OPTIMIZE gif output
// ---
@@ -631,14 +630,6 @@ static void GIF_framewrite(void)
//
INT32 GIF_open(const char *filename)
{
#if 0
if (rendermode != render_soft)
{
CONS_Alert(CONS_WARNING, M_GetText("GIFs cannot be taken in non-software modes!\n"));
return 0;
}
#endif
gif_out = fopen(filename, "wb");
if (!gif_out)
return 0;