Skip to content

Commit

Permalink
Merge pull request #880 from jgraj/patch-1
Browse files Browse the repository at this point in the history
Add an assert for `stb_vorbis_decode_memory` call
  • Loading branch information
RobDangerous authored Aug 8, 2024
2 parents bb20a3a + 9f1f5c8 commit 7ccdd1c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Sources/kinc/audio1/sound.c.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ kinc_a1_sound_t *kinc_a1_sound_create(const char *filename) {

int channels, sample_rate;
int samples = stb_vorbis_decode_memory(filedata, (int)kinc_file_reader_size(&file), &channels, &sample_rate, (short **)&data);
kinc_affirm(samples > 0);
sound->channel_count = (uint8_t)channels;
sound->samples_per_second = (uint32_t)sample_rate;
sound->size = samples * 2 * sound->channel_count;
Expand Down

0 comments on commit 7ccdd1c

Please sign in to comment.