mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-30 08:53:08 +01:00
Fix Lua AudioRom read (buffer overflow)
This commit is contained in:
parent
65ecc1b40e
commit
af254b8ff9
1 changed files with 2 additions and 1 deletions
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
#include "pbd/failed_constructor.h"
|
||||
#include "ardour/audiorom.h"
|
||||
#include "ardour/runtime_functions.h"
|
||||
|
||||
using namespace ARDOUR;
|
||||
|
||||
|
|
@ -51,6 +52,6 @@ AudioRom::read (Sample* dst, samplepos_t pos, samplecnt_t cnt, int channel) cons
|
|||
return 0;
|
||||
}
|
||||
samplecnt_t to_copy = std::min (cnt, _size - pos);
|
||||
memcpy (dst, &_rom[pos], sizeof (Sample) * _size);
|
||||
copy_vector (dst, &_rom[pos], to_copy);
|
||||
return to_copy;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue