This project has moved. For the latest updates, please go here.

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

Oct 2, 2013 at 7:22 PM
Hi

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 1.6.0.0

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.

Thanks,
Bart
Coordinator
Oct 2, 2013 at 7: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 8: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
Coordinator
Oct 2, 2013 at 8: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 9:02 PM
Seems like the best option for now yes. Best regards and thanks for your help Mark!
Oct 2, 2013 at 9:15 PM
Just found that indeed it was already fixed:

https://naudio.codeplex.com/SourceControl/changeset/bce59d5c93de

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