check index for valid before subtracting
check index for valid before subtracting

In particular, we can't blinding say index - 1 if we don't know what index
is (e.g. what if index is 0x80000000?)

Bug: oss-fuzz:6119
Change-Id: I31e7964709f9017018a51e29c306dbc48dc88f7d
Reviewed-on: https://skia-review.googlesource.com/125346
Reviewed-by: Florin Malita <a8262bf13ea8c26821e91ea9bca6740a77c96dcd@chromium.org>
Commit-Queue: Mike Reed <f5cabf8735907151a446812c9875d6c0c712d847@google.com>

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