Skip to content

Commit 65b5a7f

Browse files
authored
Fix attempted to read or write protected memory (#2)
1 parent 2f3d553 commit 65b5a7f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/encoder.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ int sampleRate, cb_codec callback, void* userdata)
104104

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

110110
size_t realrd = (psReadEnd - psRead);

0 commit comments

Comments
 (0)