Skip to content

Commit

Permalink
Fix attempted to read or write protected memory (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSnowfield authored Apr 8, 2022
1 parent 2f3d553 commit 65b5a7f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ int sampleRate, cb_codec callback, void* userdata)

/* Read input */
counter = (frameSizeReadFromFile_ms * API_fs_Hz) / 1000;
if (counter > psReadEnd - psRead) {
if (counter * sizeof(SKP_int16) > psReadEnd - psRead) {
memset(in, 0x00, sizeof(in));

size_t realrd = (psReadEnd - psRead);
Expand Down

0 comments on commit 65b5a7f

Please sign in to comment.