From 8657eceda53b94408351dfc72cc3e7799fe983ab Mon Sep 17 00:00:00 2001 From: suhyun-hwang Date: Sun, 11 Jan 2026 14:06:38 +0900 Subject: [PATCH] fix: use num_patches instead of n_pos for position array size --- tools/mtmd/clip.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/mtmd/clip.cpp b/tools/mtmd/clip.cpp index bc277e82c9..74457c0148 100644 --- a/tools/mtmd/clip.cpp +++ b/tools/mtmd/clip.cpp @@ -3506,7 +3506,7 @@ bool clip_image_batch_encode(clip_ctx * ctx, const int n_threads, const clip_ima const int pw = image_size_width / patch_size; const int ph = image_size_height / patch_size; - const int pos_size = (model.proj_type == PROJECTOR_TYPE_VAETKI) ? num_patches : n_pos; + const int pos_size = num_patches; std::vector positions(pos_size * 4); int ptr = 0; for (int y = 0; y < ph; y += merge_ratio) {