Skip to content

Commit 2ab608b

Browse files
committed
remove memset that causes buffer overflow
Co-authored-by: camel-cdr <[email protected]>
1 parent 6278c76 commit 2ab608b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

ggml/src/ggml-cpu/ggml-cpu-quants.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1674,11 +1674,10 @@ void quantize_row_q8_K(const float * restrict x, void * restrict y, int64_t k) {
16741674
for (int j = 0; j < QK_K; j += 16) {
16751675
wasm_v128_store(yc[i].qs + j, zero);
16761676
}
1677-
memset(yc[i].bsums, 0, QK_K/16 * sizeof(int));
16781677
continue;
16791678
}
16801679

1681-
const float iscale = -127.0f / max_val;
1680+
const float iscale = -127.0f / amax;
16821681
const v128_t scale_vec = wasm_f32x4_splat(iscale);
16831682

16841683
// Process 16 elements per iteration

0 commit comments

Comments
 (0)