mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-11 07:11:39 +00:00
Fix potential oob access when flipping the floor [F] in 2D mode.
git-svn-id: https://svn.eduke32.com/eduke32@3824 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
560f88b022
commit
4457a5fbca
1 changed files with 4 additions and 2 deletions
|
@ -4775,12 +4775,14 @@ static void toggle_cf_flipping(int32_t sectnum, int32_t floorp)
|
||||||
|
|
||||||
static const int16_t orient[8] = { 360, -360, -180, 180, -270, 270, 90, -90 };
|
static const int16_t orient[8] = { 360, -360, -180, 180, -270, 270, 90, -90 };
|
||||||
|
|
||||||
uint16_t *stat = &SECTORFLD(sectnum,stat, floorp);
|
const int32_t search = floorp ? SEARCH_FLOOR : SEARCH_CEILING;
|
||||||
|
|
||||||
|
uint16_t *const stat = &SECTORFLD(sectnum,stat, floorp);
|
||||||
int32_t i = *stat;
|
int32_t i = *stat;
|
||||||
|
|
||||||
i = (i&0x4)+((i>>4)&3);
|
i = (i&0x4)+((i>>4)&3);
|
||||||
i = eitherSHIFT ? prev3[i] : next3[i];
|
i = eitherSHIFT ? prev3[i] : next3[i];
|
||||||
message("Sector %d %s flip %d deg%s", searchsector, typestr[searchstat],
|
message("Sector %d %s flip %d deg%s", sectnum, typestr[search],
|
||||||
klabs(orient[i])%360, orient[i] < 0 ? " mirrored":"");
|
klabs(orient[i])%360, orient[i] < 0 ? " mirrored":"");
|
||||||
i = (i&0x4)+((i&3)<<4);
|
i = (i&0x4)+((i&3)<<4);
|
||||||
*stat &= ~0x34;
|
*stat &= ~0x34;
|
||||||
|
|
Loading…
Reference in a new issue