Skip to content

[GEN][ZH] Fix using uninitialized memory 'mask' in getHumanPlayerMask() #1114

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2897,12 +2897,20 @@ void ScriptActions::doCameraMotionBlur(Bool zoomIn, Bool saturate)

static PlayerMaskType getHumanPlayerMask( void )
{
#if RETAIL_COMPATIBLE_CRC
PlayerMaskType mask;
#else
PlayerMaskType mask = 0;
#endif
for (Int i=0; i<ThePlayerList->getPlayerCount(); ++i)
{
const Player *player = ThePlayerList->getNthPlayer(i);
if (player->getPlayerType() == PLAYER_HUMAN)
#if RETAIL_COMPATIBLE_CRC
mask &= player->getPlayerMask();
#else
mask |= player->getPlayerMask();
#endif
}

//DEBUG_LOG(("getHumanPlayerMask(): mask was %4.4X\n", mask));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2993,12 +2993,20 @@ void ScriptActions::doCameraMotionBlur(Bool zoomIn, Bool saturate)

static PlayerMaskType getHumanPlayerMask( void )
{
#if RETAIL_COMPATIBLE_CRC
PlayerMaskType mask;
#else
PlayerMaskType mask = 0;
#endif
for (Int i=0; i<ThePlayerList->getPlayerCount(); ++i)
{
const Player *player = ThePlayerList->getNthPlayer(i);
if (player->getPlayerType() == PLAYER_HUMAN)
#if RETAIL_COMPATIBLE_CRC
mask &= player->getPlayerMask();
#else
mask |= player->getPlayerMask();
#endif
}

//DEBUG_LOG(("getHumanPlayerMask(): mask was %4.4X\n", mask));
Expand Down
Loading