Comment 12 for bug 45591

Revision history for this message
In , Mwu-mozilla (mwu-mozilla) wrote :

(In reply to comment #10)
> + if (i + audio_len >= dataLen)
> + audio_len = (dataLen - i) - 1;
>
> Why are you dropping the last byte of the file?
>
Opps. I knew something was a bit off about this code.. Thanks

> Also, is it really correct to scan through
> the WAV file looking for the string "fmt "? Aren't there other chunks that
> could have binary data in them that happens to contain the string "fmt "?
>
I've added a check which makes sure we only parse one fmt chunk. It is fairly unlikely that fmt wouldn't the first chunk, so this should work out.