mtmd: several bug fixes (#24784)

* mtmd: several bug fixes

* fix build

* fix gemma4ua

* add sanity check in get_u32()

* fix build (2)

* area() avoid overflow
This commit is contained in:
Xuan-Son Nguyen
2026-06-19 12:18:36 +02:00
committed by GitHub
parent b14e3fb90c
commit e2e7a9b2d0
5 changed files with 119 additions and 72 deletions
+3
View File
@@ -24,6 +24,9 @@ struct clip_image_size {
return !(*this == other);
}
int area() const {
// avoid overflow when computing area
GGML_ASSERT(width >= 0 && width <= 46000);
GGML_ASSERT(height >= 0 && height <= 46000);
return width * height;
}
};