SkVertices: Fix out-of-memory errors in deserialization

It was easy to construct a buffer that indicated enormous amounts of
memory had to be allocated. An easy guard is to bail out if the buffer
can't possibly fill those buffers.

Simplify the code a bit: Four years ago (well past the earliest
supported SKP version), we stopped writing out triangle fan data (by
converting to tri-lists at construction time). Remove the
deserialization support, which makes the code easier to follow.

Bug: oss-fuzz:48228
Bug: oss-fuzz:48231
Change-Id: I941da595a250f940316a48cb54caeaec47768973
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/556021
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
1 file changed