Skip to content

Commit 9d0dda7

Browse files
committed
Fix potential overflow
1 parent 7ee9983 commit 9d0dda7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bindings/ruby/ext/ruby_whisper_transcribe.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ ruby_whisper_transcribe(int argc, VALUE *argv, VALUE self) {
110110
}
111111
} else {
112112
for (uint64_t i = 0; i < n; i++) {
113-
pcmf32[i] = float(pcm16[2*i] + pcm16[2*i + 1])/65536.0f;
113+
pcmf32[i] = float((int32_t)pcm16[2*i] + pcm16[2*i + 1])/65536.0f;
114114
}
115115
}
116116

0 commit comments

Comments
 (0)