Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Syoyo Fujita
2026-05-03 01:42:48 +09:00
committed by GitHub
parent 721430aa5f
commit aa41d25054

View File

@@ -5151,6 +5151,13 @@ TINYGLTF3_API tg3_error_code tg3_validate(
i, img->buffer_view, model->buffer_views_count);
}
if (img->buffer_view >= 0 &&
(img->mime_type.data == NULL || img->mime_type.len == 0)) {
TG3__VERR(TG3_ERR_INVALID_IMAGE, path,
"image[%u] uses bufferView but is missing mimeType",
i);
}
/* An image should have either a URI or a bufferView */
{
int has_uri = (img->uri.data != NULL && img->uri.len > 0);