fix: use num_patches instead of n_pos for position array size

This commit is contained in:
suhyun-hwang 2026-01-11 14:06:38 +09:00
parent c9e44c7451
commit 8657eceda5
1 changed files with 1 additions and 1 deletions

View File

@ -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<int> positions(pos_size * 4);
int ptr = 0;
for (int y = 0; y < ph; y += merge_ratio) {