Add checks for TextureSampler count in text GeoProcs.

Chrome is seeing unexplained segfaults when trying to access the n-1th
textureSampler while creating textOp GeoProcs -- it's possible that's
because n is 0. Also add checks to make sure n is not > kMaxTextures.

Bug: chromium:1027314
Change-Id: I65a5472980bab37d580b3f237a132a8b23794abe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255985
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/effects/GrBitmapTextGeoProc.cpp b/src/gpu/effects/GrBitmapTextGeoProc.cpp
index 0393433..1cec0a1 100644
--- a/src/gpu/effects/GrBitmapTextGeoProc.cpp
+++ b/src/gpu/effects/GrBitmapTextGeoProc.cpp
@@ -164,6 +164,8 @@
                                         int numActiveProxies,
                                         const GrSamplerState& params) {
     SkASSERT(numActiveProxies <= kMaxTextures);
+    // Just to make sure we don't try to add too many proxies
+    numActiveProxies = SkTMin(numActiveProxies, kMaxTextures);
 
     if (!fTextureSamplers[0].isInitialized()) {
         fAtlasDimensions = proxies[0]->dimensions();