Comment 3 for bug 336476

Revision history for this message
Nick (kousu) wrote :

I did some bug hunting this afternoon. The problem is in bpm/bpmdetect.cpp::decimate(). It doesn't bounds-check the dest array (fixed at 256 bytes) as it's writing into it. The problem only shows up on these files because they have a sample rate of 22050 wheras the common rate is double that.

I don't know how to fix it, though. I don't know if I should make the size of the dest array (DECIMATED_BLOCK_SAMPLES) to depend on the sample rate, or if I should change BPM_NUM_SAMPLES to depend on the sample rate, or if I should do a mix of both or neither. I'm not familiar with this code at all, and I'm half-guessing at the math it's using and I don't want to break it.