Browse Source

Don't attempt to load wavetables more than 1M points.

tags/v2.0.1
Andrew Belt 3 years ago
parent
commit
28c17aa8c9
2 changed files with 6 additions and 2 deletions
  1. +1
    -1
      src/Scope.cpp
  2. +5
    -1
      src/Wavetable.hpp

+ 1
- 1
src/Scope.cpp View File

@@ -180,7 +180,7 @@ struct Scope : Module {
};


struct ScopeDisplay : TransparentWidget {
struct ScopeDisplay : LedDisplay {
Scope* module;
int statsFrame = 0;
std::string fontPath;


+ 5
- 1
src/Wavetable.hpp View File

@@ -158,8 +158,12 @@ struct Wavetable {
#endif
return;

size_t len = wav.totalPCMFrameCount * wav.channels;
if (len == 0 || len >= (1 << 20))
return;

samples.clear();
samples.resize(wav.totalPCMFrameCount * wav.channels);
samples.resize(len);

drwav_read_pcm_frames_f32(&wav, wav.totalPCMFrameCount, samples.data());
drwav_uninit(&wav);


Loading…
Cancel
Save