diff options
author | Robin Gareus <robin@gareus.org> | 2019-08-12 15:02:24 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2019-08-12 15:02:24 +0200 |
commit | 98c65406e3e17bc70840cc531424e0c65521b96b (patch) | |
tree | 343448adef0c66c8b0aae2ceac1f7881ee1a3a8c /libs/audiographer/audiographer | |
parent | b48a3a6abb9925b1a999755db79a0ea4ddd1a7fe (diff) |
Prefer std::vector<> over C-style malloc/free**
This fixes a potential out of bounds read `if (_dbtp_plugin[c])`
if c is larger than the allocated channel count.
Diffstat (limited to 'libs/audiographer/audiographer')
-rw-r--r-- | libs/audiographer/audiographer/general/loudness_reader.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libs/audiographer/audiographer/general/loudness_reader.h b/libs/audiographer/audiographer/general/loudness_reader.h index 0ee4b5bae0..94643c2133 100644 --- a/libs/audiographer/audiographer/general/loudness_reader.h +++ b/libs/audiographer/audiographer/general/loudness_reader.h @@ -19,6 +19,8 @@ #ifndef AUDIOGRAPHER_LOUDNESS_READER_H #define AUDIOGRAPHER_LOUDNESS_READER_H +#include <vector> + #include <vamp-hostsdk/PluginLoader.h> #include "audiographer/visibility.h" @@ -47,8 +49,8 @@ class LIBAUDIOGRAPHER_API LoudnessReader : public ListedSource<float>, public Si using Sink<float>::process; protected: - Vamp::Plugin* _ebur_plugin; - Vamp::Plugin** _dbtp_plugin; + Vamp::Plugin* _ebur_plugin; + std::vector<Vamp::Plugin*> _dbtp_plugins; float _sample_rate; unsigned int _channels; |