mirror of
https://github.com/LMMS/lmms.git
synced 2026-05-17 11:18:30 -04:00
Fixes bug on SampleBuffer::decodeSampleSF (#5796)
As requested, this PR extracts the bug fix from #5971. More details about the bug on the mentioned PR page, but basically the variable sf_rr was declared with the wrong type causing the conditional that checks for errors on the loading to return true even when there were no errors (only noticeable with DEBUG builds). This renames the variable and uses the correct type.
This commit is contained in:
@@ -391,7 +391,7 @@ f_cnt_t SampleBuffer::decodeSampleSF(QString _f,
|
||||
SF_INFO sf_info;
|
||||
sf_info.format = 0;
|
||||
f_cnt_t frames = 0;
|
||||
bool sf_rr = false;
|
||||
sf_count_t sfFramesRead;
|
||||
|
||||
|
||||
// Use QFile to handle unicode file names on Windows
|
||||
@@ -402,9 +402,9 @@ f_cnt_t SampleBuffer::decodeSampleSF(QString _f,
|
||||
frames = sf_info.frames;
|
||||
|
||||
_buf = new sample_t[sf_info.channels * frames];
|
||||
sf_rr = sf_read_float( snd_file, _buf, sf_info.channels * frames );
|
||||
sfFramesRead = sf_read_float(snd_file, _buf, sf_info.channels * frames);
|
||||
|
||||
if( sf_rr < sf_info.channels * frames )
|
||||
if (sfFramesRead < sf_info.channels * frames)
|
||||
{
|
||||
#ifdef DEBUG_LMMS
|
||||
qDebug( "SampleBuffer::decodeSampleSF(): could not read"
|
||||
|
||||
Reference in New Issue
Block a user