Validate compressed audio formats.
Fix null checks in afGetSampleFormat() and afGetVirtualSampleFormat().

Thanks to David Lassonde for pointing out this problem.
Fix conversion specifications in error messages.