This project has moved and is read-only. For the latest updates, please go here.

System.NullReferenceException in NAudio.Wave.AcmMp3FrameDecompressor.Dispose()

Oct 2, 2013 at 8:22 PM

We received an error report about our software (using NAudio) aborting with an unhandled exception on the following call stack:
System.NullReferenceException: Object reference not set to an instance of an object.
   at NAudio.Wave.AcmMp3FrameDecompressor.Dispose()
   at NAudio.Wave.AcmMp3FrameDecompressor.Finalize()
We're using NAudio.dll

Any clues? I guess we can recompile the sources and add a condition in the Dispose(). Strange thing is that on most systems the code works just fine.

Oct 2, 2013 at 8:41 PM
hmm, there is a check for null reference in the latest code. Might be worth upgrading to the beta of NAudio 1.7.
It might be an exception is being raised in the constructor, leaving a half-constructed object to be disposed
Oct 2, 2013 at 9:47 PM
Thanks Mark, but we're still on .NET 2.0, seems latest sources don't compile on .NET 2.0 due to default parameter specifiers
Oct 2, 2013 at 9:54 PM
Shame, I'm using .NET 3.5 mainly for extension methods and a bit of LINQ. You could quite easily make the same change against the code for v1.6 though
Oct 2, 2013 at 10:02 PM
Seems like the best option for now yes. Best regards and thanks for your help Mark!
Oct 2, 2013 at 10:15 PM
Just found that indeed it was already fixed:

will apply these changes to the 1.6 codebase!
Marked as answer by excode on 10/3/2013 at 1:25 PM