SkPath.readFromMemory:  check for error case

Fuzzing can produce inconsistant data, such as flags or bounds.

Also, use std::unique_ptr to reduce the need for calling `delete`.

BUG=skia:6262
BUG=skia:6263
Change-Id: I1de6b5f764cda346bb3cd5cd4698816b6b68f395
Reviewed-on: https://skia-review.googlesource.com/8812
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
1 file changed