Ensure fSrcOffsetUnits is in a valid range

Bug: oss-fuzz:11114

fSrcOffsetUnits is where we start sampling from the image. It is
computed as

  (sampleX / 2) * fSrcBPP

(ignoring fSrcOffset, which is 0 for a GIF with a subset frame).
sampleX will be no wider than the full image, and we divide it by two to
sample points evenly spread through the image. But for a subset frame,
we need to use a different sampling rate to ensure that the sampled
points are within the width of the frame.

Change-Id: I4a313db096fbaea7d869927a9da5df9beb9f6706
Reviewed-on: https://skia-review.googlesource.com/c/165500
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
1 file changed