diff options
-rw-r--r-- | OpenAL32/alFontsound.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/OpenAL32/alFontsound.c b/OpenAL32/alFontsound.c index 670fddad..1e2c303d 100644 --- a/OpenAL32/alFontsound.c +++ b/OpenAL32/alFontsound.c @@ -821,17 +821,13 @@ void ALfontsound_setPropi(ALfontsound *self, ALCcontext *context, ALenum param, break; case AL_FONTSOUND_LINK_SOFT: - if(!value) - link = NULL; - else - { - link = LookupFontsound(context->Device, value); - if(!link) - SET_ERROR_AND_RETURN(context, AL_INVALID_VALUE); - } + link = value ? LookupFontsound(context->Device, value) : NULL; + if(value && !link) + SET_ERROR_AND_RETURN(context, AL_INVALID_VALUE); + if(link) IncrementRef(&link->ref); - link = ExchangePtr((XchgPtr*)&self->Link, link); - if(link) DecrementRef(&link->ref); + if((link=ExchangePtr((XchgPtr*)&self->Link, link)) != NULL) + DecrementRef(&link->ref); break; default: |