mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-24 08:10:05 +02:00
Assert that sampleCount doesn't narrow converting to 3d party types
This commit is contained in:
parent
26b5e77050
commit
99dca62cff
@ -528,6 +528,9 @@ int ODPCMAliasBlockFile::ReadData(samplePtr data, sampleFormat format,
|
||||
|
||||
mSilentAliasLog=FALSE;
|
||||
|
||||
// Third party library has its own type alias, check it
|
||||
static_assert(sizeof(sampleCount::type) <= sizeof(sf_count_t),
|
||||
"Type sf_count_t is too narrow to hold a sampleCount");
|
||||
SFCall<sf_count_t>(sf_seek, sf.get(), mAliasStart + start, SEEK_SET);
|
||||
|
||||
wxASSERT(info.channels >= 0);
|
||||
|
@ -116,6 +116,9 @@ int PCMAliasBlockFile::ReadData(samplePtr data, sampleFormat format,
|
||||
}
|
||||
mSilentAliasLog=FALSE;
|
||||
|
||||
// Third party library has its own type alias, check it
|
||||
static_assert(sizeof(sampleCount::type) <= sizeof(sf_count_t),
|
||||
"Type sf_count_t is too narrow to hold a sampleCount");
|
||||
SFCall<sf_count_t>(sf_seek, sf.get(), mAliasStart + start, SEEK_SET);
|
||||
wxASSERT(info.channels >= 0);
|
||||
SampleBuffer buffer(len * info.channels, floatSample);
|
||||
|
@ -306,11 +306,15 @@ bool EffectSBSMS::Process()
|
||||
outResampleCB = resampleCB;
|
||||
rb.offset = start;
|
||||
rb.end = end;
|
||||
// Third party library has its own type alias, check it
|
||||
static_assert(sizeof(sampleCount::type) <=
|
||||
sizeof(_sbsms_::SampleCountType),
|
||||
"Type _sbsms_::SampleCountType is too narrow to hold a sampleCount");
|
||||
rb.iface = std::make_unique<SBSMSInterfaceSliding>(&rateSlide,&pitchSlide,
|
||||
bPitchReferenceInput,
|
||||
samplesToProcess,0,
|
||||
nullptr);
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
rb.bPitch = false;
|
||||
|
@ -190,6 +190,10 @@ int ODFlacDecoder::Decode(SampleBuffer & data, sampleFormat & format, sampleCoun
|
||||
|
||||
mTargetChannel=channel;
|
||||
|
||||
// Third party library has its own type alias, check it
|
||||
static_assert(sizeof(sampleCount::type) <=
|
||||
sizeof(FLAC__int64),
|
||||
"Type FLAC__int64 is too narrow to hold a sampleCount");
|
||||
if(!mFile->seek_absolute(start))
|
||||
{
|
||||
mFlacFileLock.Unlock();
|
||||
|
Loading…
x
Reference in New Issue
Block a user