egametang/ET · error · Exception

too fig file

Error message

too fig file

What it means

CreateBlocksStream (line 164) throws 'too fig file' (typo for 'too big') when the sum of all StorageBlock.uncompressedSize across the bundle reaches or exceeds int.MaxValue (~2 GiB). The reader allocates a single MemoryStream with an int capacity, so it cannot hold more than ~2 GiB of decompressed block data.

Source

Thrown at Packages/cn.etetet.hybridclr/Scripts/Editor/Share/3rds/UnityFS/BundleFileReader.cs:164

                        flags = blocksInfoReader.ReadUInt32(),
                        path = blocksInfoReader.ReadStringToNull(),
                    };
                }
            }
            if (m_Header.flags.HasFlag(ArchiveFlags.BlockInfoNeedPaddingAtStart))
            {
                reader.AlignStream(16);
            }
        }


        private Stream CreateBlocksStream()
        {
            Stream blocksStream;
            var uncompressedSizeSum = m_BlocksInfo.Sum(x => x.uncompressedSize);
            if (uncompressedSizeSum >= int.MaxValue)
            {
                throw new Exception($"too fig file");
            }
            else
            {
                blocksStream = new MemoryStream((int)uncompressedSizeSum);
            }
            return blocksStream;
        }

        public void ReadFiles(Stream blocksStream)
        {
            fileList = new StreamFile[m_DirectoryInfo.Length];
            for (int i = 0; i < m_DirectoryInfo.Length; i++)
            {
                var node = m_DirectoryInfo[i];
                var file = new StreamFile();
                fileList[i] = file;
                file.path = node.path;
                file.fileName = Path.GetFileName(node.path);

View on GitHub (pinned to 5cab01f7a8)

Solutions

  1. Split the oversized bundle into smaller bundles (< 2 GiB decompressed).
  2. Verify the blocksInfo were parsed correctly (a corrupted header can fabricate huge sizes).
  3. If a legitimately large asset set is needed, package it across multiple bundles.
  4. Long term, switch CreateBlocksStream to a stream that supports >2 GiB (and fix the message typo).
Defensive patterns

Strategy: validation

Validate before calling

ulong total = (ulong)m_BlocksInfo.Sum(x => (long)x.uncompressedSize);
if (total >= int.MaxValue) throw new InvalidDataException($"bundle decompressed size {total} exceeds 2GiB single-stream limit");

Prevention

When it happens

Trigger: Loading a UnityFS asset bundle whose total decompressed block size is >= 2 GiB - a very large bundle, or a bundle whose blocksInfo were parsed from a corrupted header yielding a huge spurious uncompressedSize.

Common situations: Shipping a giant monolithic asset bundle, a corrupted blocksInfo array inflating sizes, or an asset collection that grew past the 2 GiB single-stream ceiling.

Related errors


AI-assisted analysis of egametang/ET@5cab01f7a8 (2026-08-13). Data as JSON: /api/errors/34005abeef67c641. Report an issue: GitHub.