mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2024-11-10 06:51:54 +00:00
Fix bugs in fluid_sample_set_sound_data with copy enabled
- memset should clear all the memory - end position should be at the end of sample data Closes #576 Signed-off-by: Stefan Westerfeld <stefan@space.twc.de>
This commit is contained in:
parent
a94bc82a3c
commit
50dd443c20
1 changed files with 2 additions and 2 deletions
|
@ -608,7 +608,7 @@ fluid_sample_set_sound_data(fluid_sample_t *sample,
|
|||
goto error_rec;
|
||||
}
|
||||
|
||||
FLUID_MEMSET(sample->data, 0, storedNbFrames);
|
||||
FLUID_MEMSET(sample->data, 0, storedNbFrames * sizeof(short));
|
||||
FLUID_MEMCPY(sample->data + SAMPLE_LOOP_MARGIN, data, nbframes * sizeof(short));
|
||||
|
||||
if(data24 != NULL)
|
||||
|
@ -627,7 +627,7 @@ fluid_sample_set_sound_data(fluid_sample_t *sample,
|
|||
/* pointers */
|
||||
/* all from the start of data */
|
||||
sample->start = SAMPLE_LOOP_MARGIN;
|
||||
sample->end = SAMPLE_LOOP_MARGIN + storedNbFrames - 1;
|
||||
sample->end = SAMPLE_LOOP_MARGIN + nbframes - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue