Return nullptr from readFlattenable when invalid
Return nullptr from readFlattenable when invalid

Currently, in SkReadBuffer::readFlattenable, if reading the sizeRecorded
fails (or any previous read), then the read buffer is invalid and the
size returns zero.  In this bug, it calls SkLine2DPathEffect::CreateProc
which never checks the validity of the readBuffer and returns a
valid object.  Because the read size also is zero, then unset
but seemingly valid object gets returned to the caller.

Other failure cases return nullptr when the readBuffer is invalid, so
instead of making all procs handle this, just handle this at the end
of readFlattenable.

It'd be ideal if SkFlattenable::Deserialize could forward this error
back to the caller, but this seems like a smaller fix.

Bug: chromium: 854947
Change-Id: I26e4e90320c0d2c4efa191d301aa4ac7783eb476
Reviewed-on: https://skia-review.googlesource.com/138000
Commit-Queue: Mike Klein <14574f09dfa9b4e14759b88c3426a495a0e627b0@google.com>
Reviewed-by: Mike Klein <14574f09dfa9b4e14759b88c3426a495a0e627b0@google.com>

Hikari-no-Tenshi/android_external_skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,rubenvb/skia,google/skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,HalCanary/skia-hc,google/skia,rubenvb/skia,rubenvb/skia,HalCanary/skia-hc,HalCanary/skia-hc,aosp-mirror/platform_external_skia,HalCanary/skia-hc,rubenvb/skia,google/skia,rubenvb/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,rubenvb/skia,Hikari-no-Tenshi/android_external_skia,Hikari-no-Tenshi/android_external_skia,Hikari-no-Tenshi/android_external_skia,aosp-mirror/platform_external_skia,rubenvb/skia,HalCanary/skia-hc,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,Hikari-no-Tenshi/android_external_skia,rubenvb/skia,google/skia,rubenvb/skia,Hikari-no-Tenshi/android_external_skia,google/skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,Hikari-no-Tenshi/android_external_skia,google/skia,Hikari-no-Tenshi/android_external_skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,google/skia,rubenvb/skia,google/skia,google/skia,google/skia