Potential problem with AudioUnitReset
Potential problem with AudioUnitReset
- Subject: Potential problem with AudioUnitReset
- From: William Stewart <email@hidden>
- Date: Sat, 3 Jul 2004 13:18:57 -0700
We've just found a couple of AU's that will crash if you set the bypass
property before the AU has been initialized.
The reason for the crash appears to be calls to AudioUnitReset when the
AU is not initialized (and it manifests in this instance because the
implementation of setting bypass in AUEffectBase is to always call
Reset if bypass was on and is being turned off).
One possible change is for AUEffectBase is to only call Reset if the AU
is initialized - a reasonable enough change on the surface as Reset
does not need to do anything if the AU is not Initialized.
However, that is not sufficient and the correct solution is to have any
implementation of Reset protected against being called if they are not
initialized (It is not required that hosts can only call Reset if your
AU is initialized, so unless the problem is fixed in the Reset call,
the potential still exists for a crash to occur. We'll be adding this
test to the Validation tool)...
Thus:
OSStatus MyEffect::Reset (...)
{
if (!IsInitialized()) return noErr;
}
(If you aren't initialized and your Reset call is not checking for
this, it may end up dereferencing state that hasn't been allocated
yet). AUEffectBase's implementation of Reset guards against this by
checking the state of its kernel list (so this probably isn't a problem
for many AU's).
Bill
--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________
__
Culture Ship Names:
Ravished By The Sheer Implausibility Of That Last Statement [GSV]
I said, I've Got A Big Stick [OU]
Inappropiate Response [OU]
Far Over The Borders Of Insanity And Still Accelerating [Eccentric]
________________________________________________________________________
__
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.