Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fx_play_visual_effect: check for null target earlier (potential crash)

coverity 4464
  • Loading branch information...
commit 7206fda80df61a4dd01a09e271f3aedf09c1560c 1 parent 8776b90
@lynxlynxlynx lynxlynxlynx authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 gemrb/plugins/FXOpcodes/FXOpcodes.cpp
View
4 gemrb/plugins/FXOpcodes/FXOpcodes.cpp
@@ -5489,7 +5489,7 @@ int fx_play_visual_effect (Scriptable* /*Owner*/, Actor* target, Effect* fx)
if(0) print("fx_play_visual_effect(%2d): Resource: %s Type: %d", fx->Opcode, fx->Resource, fx->Parameter2);
//this is in the original engine (dead actors lose this effect)
- if (STATE_GET( STATE_DEAD) ) {
+ if (!target || STATE_GET(STATE_DEAD)) {
return FX_NOT_APPLIED;
}
@@ -5532,7 +5532,7 @@ int fx_play_visual_effect (Scriptable* /*Owner*/, Actor* target, Effect* fx)
}
//not sticky
- if (fx->Parameter2 == 2 || !target) {
+ if (fx->Parameter2 == 2) {
sca->XPos = fx->PosX;
sca->YPos = fx->PosY;
} else {
Please sign in to comment.
Something went wrong with that request. Please try again.