Skip to content

Commit

Permalink
fix: multiplication result overflow u32 before converted to usz (…
Browse files Browse the repository at this point in the history
…#147)
  • Loading branch information
iWas-Coder committed Jun 19, 2024
1 parent e5b50df commit 4a806ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/skap/src/skap_idx_audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ u8 skap_idx_audio_blob_append(FILE *fd, const char *name, Wave *audio) {
return 0;
}
printf(" WRITE %s >> " SKAP_FILENAME "\n", name);
size_t audio_len = audio->frameCount * audio->channels * (audio->sampleSize / 8);
usz audio_len = (usz) audio->frameCount * audio->channels * (audio->sampleSize / 8);
if (fwrite(audio->data, sizeof(u8), audio_len, fd) != audio_len) {
fprintf(stderr, "ERROR: skap_idx_audio_blob_append :: unable to write to file\n");
return 0;
Expand Down

0 comments on commit 4a806ae

Please sign in to comment.