Comment 11 for bug 45591

Revision history for this message
In , Roc-ocallahan (roc-ocallahan) wrote :

+ if (i + audio_len >= dataLen)
+ audio_len = (dataLen - i) - 1;

Why are you dropping the last byte of the file?

+ for (PRUint32 j = 0; j < audio_len - 1; j += 2) {

I'd prefer "j + 2 <= audio_len"

+ } else
+ i++;

I'd prefer braces around the i++. 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 "?