SixWays / UnityShaderStripper

Modular utilities for shader stripping to drastically improve Unity build times
MIT License
351 stars 42 forks source link

Account for empty variant arrays in parser #12

Open Grimeh opened 4 months ago

Grimeh commented 4 months ago

It's possible for entries in .shadervariants assets to have an empty variants array. Eg. variants: [].

This causes the parser to go out-of-bounds in the yaml list when the final entry has an empty variants array. When not the final entry, it probably causes the next entry to be parsed incorrectly.

Example of empty variant array:

  - first: {fileID: 4800000, guid: a5e0f9ecc5bd641c0b9a6c17fa79ded3, type: 3}
    second:
      variants: []