Skip to content

Commit

Permalink
voc: Fix possible buffer overflow when decoding.
Browse files Browse the repository at this point in the history
Fixes #104.
  • Loading branch information
icculus committed Dec 26, 2024
1 parent 5d983db commit 16e6265
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/SDL_sound_voc.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ static Uint32 VOC_read(Sound_Sample *sample)
v->bufpos = 0;
while (v->bufpos < internal->buffer_size)
{
Uint32 rc = voc_read_waveform(sample, 1, internal->buffer_size);
Uint32 rc = voc_read_waveform(sample, 1, internal->buffer_size - v->bufpos);
if (rc == 0)
{
sample->flags |= (v->error) ?
Expand Down

0 comments on commit 16e6265

Please sign in to comment.