Fix fuzzer-discovered timeout with deeply-nested structs.

The fuzzer found that `is_too_deeply_nested` would walk the entire
struct hierarchy, and crafted a massive tree of structs in order to
trigger a timeout. We now memoize the nesting depth of the most
deeply-nested field of each struct.

Change-Id: I1e6def90c46cb1951dc8ca46e1c6f53b8595a5a6
Bug: oss-fuzz:64293
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/780916
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2 files changed