diff --git a/src/components/CloudLoader.tsx b/src/components/CloudLoader.tsx index 6b82903..e3e399f 100644 --- a/src/components/CloudLoader.tsx +++ b/src/components/CloudLoader.tsx @@ -119,6 +119,14 @@ export function CloudLoader({ compact = false, variant = 'outline', className }: const response = await smartFetch(rawUrl); const buffer = await response.arrayBuffer(); + // Valida tamanho + assinatura antes de converter + const sig = validateModelFile(fileName, buffer.byteLength, ext, buffer); + if (!sig.ok) { + toast.error(sig.reason!); + if (sig.detail) console.warn('[validateModelFile]', sig.detail); + return; + } + let blob: Blob, outName = fileName, outSize = buffer.byteLength; if (ext === 'glb') { blob = new Blob([buffer], { type: 'model/gltf-binary' });