|
|
Rockbox mail archiveSubject: buffer overflow in dsp.c when playing low-frequency stereo filesbuffer overflow in dsp.c when playing low-frequency stereo files
From: Frederic Devernay <frederic.devernay_at_m4x.org>
Date: 2005-08-10
Hello,
Hi just added this patch:
If you happen to play 8kHz stereo files on rockbox with the DSP enabled (e.g. on
After a few hours of work on this, I finally found this comment in dsp.c:
#define RESAMPLE_BUF_SIZE (256 * 4) /* Enough for 11,025 Hz -> 44,100 Hz*/
But in fact, the fix for this was not to change this buffer size! Almost
I also thought carefully about what these functions should return:
In fact, I could rewrite dsp_input_size() so that it gives the _exact_ input
Consequently, dsp_input_size() should ALWAYS be called after dsp_output_size(),
In case there remains a bug in my code, I put some protection code, and DEBUGF()
Now, you can play audio data sampled at ANY frequency on rockbox.
Oh, the patch adds also one line to playback.c so that rockbox doesn't crash
Fred
Page was last modified "Jan 10 2012" The Rockbox Crew |