Add error checking to avoid invalid clamp
Add error checking to avoid invalid clamp

Change-Id: I427b78588aaa6836744f385b03151723374b8d0e

GrokImageCompression/aom,GrokImageCompression/aom,GrokImageCompression/aom,GrokImageCompression/aom,GrokImageCompression/aom,GrokImageCompression/aom