mirror of
https://github.com/cookiengineer/audacity
synced 2025-12-12 07:36:24 +01:00
Comment more cases of bad sampleCount truncation, and even worse...
... but whatever the intent was, this class isn't used anywhere.
This commit is contained in:
@@ -124,6 +124,7 @@ bool CrossFader::CrossFadeMix(samplePtr buffer, sampleFormat format, sampleCount
|
|||||||
|
|
||||||
//Copy the sequences over to the NEW vector, casting as you go.
|
//Copy the sequences over to the NEW vector, casting as you go.
|
||||||
for(int i = 0; i < numclips; i++)
|
for(int i = 0; i < numclips; i++)
|
||||||
|
// PRL: what the ... ? This cast is just wrong!
|
||||||
shortSeq.push_back((short*)tmpSequence[i]);
|
shortSeq.push_back((short*)tmpSequence[i]);
|
||||||
|
|
||||||
|
|
||||||
@@ -141,6 +142,8 @@ bool CrossFader::CrossFadeMix(samplePtr buffer, sampleFormat format, sampleCount
|
|||||||
if(j + clipStart[i] >= 0 &&
|
if(j + clipStart[i] >= 0 &&
|
||||||
clipStart[i]+len < clipLength[i])//only copy if we are within the clip
|
clipStart[i]+len < clipLength[i])//only copy if we are within the clip
|
||||||
{
|
{
|
||||||
|
// UNSAFE_SAMPLE_COUNT_TRUNCATION
|
||||||
|
// -- but class CrossFader is not used as of this writing
|
||||||
f += shortSeq[i][j+ clipStart[i]];
|
f += shortSeq[i][j+ clipStart[i]];
|
||||||
clips++;
|
clips++;
|
||||||
}
|
}
|
||||||
@@ -171,6 +174,8 @@ bool CrossFader::CrossFadeMix(samplePtr buffer, sampleFormat format, sampleCount
|
|||||||
|
|
||||||
//Copy the sequences over to the NEW vector, casting as you go.
|
//Copy the sequences over to the NEW vector, casting as you go.
|
||||||
for(int i = 0; i < numclips; i++)
|
for(int i = 0; i < numclips; i++)
|
||||||
|
// Murder most foul! As in the best it is,
|
||||||
|
// But this most foul, strange, and unnatural.
|
||||||
intSeq.push_back((int*)tmpSequence[i]);
|
intSeq.push_back((int*)tmpSequence[i]);
|
||||||
|
|
||||||
int clips=0;
|
int clips=0;
|
||||||
@@ -187,6 +192,8 @@ bool CrossFader::CrossFadeMix(samplePtr buffer, sampleFormat format, sampleCount
|
|||||||
//only copy if we are within the clip
|
//only copy if we are within the clip
|
||||||
if(j + clipStart[i] >= 0 && clipStart[i] + len < clipLength[i])
|
if(j + clipStart[i] >= 0 && clipStart[i] + len < clipLength[i])
|
||||||
{
|
{
|
||||||
|
// UNSAFE_SAMPLE_COUNT_TRUNCATION
|
||||||
|
// -- but class CrossFader is not used as of this writing
|
||||||
f+= intSeq[i][j+clipStart[i]];
|
f+= intSeq[i][j+clipStart[i]];
|
||||||
clips++;
|
clips++;
|
||||||
}
|
}
|
||||||
@@ -231,6 +238,11 @@ bool CrossFader::CrossFadeMix(samplePtr buffer, sampleFormat format, sampleCount
|
|||||||
if(j + clipStart[i] >= 0 &&
|
if(j + clipStart[i] >= 0 &&
|
||||||
clipStart[i] + j < clipLength[i])//only copy if we are within the clip
|
clipStart[i] + j < clipLength[i])//only copy if we are within the clip
|
||||||
{
|
{
|
||||||
|
// UNSAFE_SAMPLE_COUNT_TRUNCATION
|
||||||
|
// -- but class CrossFader is not used as of this writing
|
||||||
|
// -- hey wait, you never even tried to initialize floatSeq,
|
||||||
|
// not even with bad casts!!!
|
||||||
|
// Subscripts out of bounds, bombs away!!!
|
||||||
f += floatSeq[i][j + clipStart[i]];
|
f += floatSeq[i][j + clipStart[i]];
|
||||||
clips++;
|
clips++;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user