Skip to content

Commit c24bb8d

Browse files
committed
Fixes analyzer issue: Access to instance variable results in null pointer dereference
If error != NO_ERROR, we release and nillify self, then touch _source. Put subsequent code in else block.
1 parent aac51d6 commit c24bb8d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/Core/OOALSoundChannel.m

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,12 @@ - (id) init
5353
[self release];
5454
self = nil;
5555
}
56-
// sources are all relative to listener, defaulting to zero vector
57-
OOAL(alSourcei(_source, AL_SOURCE_RELATIVE, AL_TRUE));
58-
OOAL(alSource3f(_source, AL_POSITION, 0.0f, 0.0f, 0.0f));
56+
else
57+
{
58+
// sources are all relative to listener, defaulting to zero vector
59+
OOAL(alSourcei(_source, AL_SOURCE_RELATIVE, AL_TRUE));
60+
OOAL(alSource3f(_source, AL_POSITION, 0.0f, 0.0f, 0.0f));
61+
}
5962
}
6063
return self;
6164
}

0 commit comments

Comments
 (0)