handle malloc failures in ff_get_wav_header