Skip to content

Commit

Permalink
Fixed|Particles: Out-of-bounds memory access
Browse files Browse the repository at this point in the history
Apparently spinIndex was sometimes incorrectly calculated on
p_particle.cpp:794.
  • Loading branch information
skyjake committed Jan 13, 2014
1 parent 7a339f5 commit e2ebe9f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion doomsday/client/src/world/p_particle.cpp
Expand Up @@ -791,7 +791,9 @@ void Generator::spinParticle(ParticleInfo &pinfo)
static int const pitchSigns[4] = { 1, -1, 1, -1 };

ded_ptcstage_t const *stDef = &def->stages[pinfo.stage];
uint const spinIndex = (&pinfo - &_pinfo[id() / 8]) % 4;
uint const spinIndex = uint(&pinfo - &_pinfo[id() / 8]) % 4;

DENG_ASSERT(spinIndex < 4);

int const yawSign = yawSigns[spinIndex];
int const pitchSign = pitchSigns[spinIndex];
Expand Down
2 changes: 1 addition & 1 deletion doomsday/libappfw/include/de/widgets/commandwidget.h
Expand Up @@ -79,7 +79,7 @@ public slots:
signals:
void gotFocus();
void lostFocus();
void commandEntered(String const &command);
void commandEntered(de::String const &command);

private:
DENG2_PRIVATE(d)
Expand Down
2 changes: 1 addition & 1 deletion doomsday/plugins/common/src/g_game.c
Expand Up @@ -1167,7 +1167,7 @@ static void printMapBanner(void)
#else
dd_snprintf(buf, 64, "Map %u: " DE2_ESC(b) "%s", gameMap+1, name);
#endif
App_Log(DE2_LOG_MAP, "%s", buf);
App_Log(DE2_MAP_NOTE, "%s", buf);
}

#if !__JHEXEN__
Expand Down

0 comments on commit e2ebe9f

Please sign in to comment.