1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-26 07:13:49 +01:00

Assert that sampleCount doesn't narrow converting to 3d party types

This commit is contained in:
Paul Licameli
2016-08-29 08:50:11 -04:00
parent 26b5e77050
commit 99dca62cff
4 changed files with 15 additions and 1 deletions

View File

@@ -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);

View File

@@ -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);