Remove extra "+ rowNumber" This was accidentally introduced in https://skia-review.googlesource.com/13274. That CL replaced frameContext->yOffset() + rowNumber + repeatCount with yBegin + rowNumber + repeatCount (ignoring the static_cast), but yBegin = frameContext->yOffset() + rowNumber, so this introduced an extra rowNumber. The error is harmless (yEnd is only compared against yBegin), but this commit makes the line more correct. Change-Id: I5a895eae03cbe55f8cf518d57e08c03400385e1f Reviewed-on: https://skia-review.googlesource.com/c/libgifcodec/+/339830 Commit-Queue: Leon Scroggins <scroggo@google.com> Commit-Queue: Derek Sollenberger <djsollen@google.com> Auto-Submit: Leon Scroggins <scroggo@google.com> Reviewed-by: Derek Sollenberger <djsollen@google.com>
diff --git a/SkLibGifCodec.cpp b/SkLibGifCodec.cpp index d0752ed..71d0e81 100644 --- a/SkLibGifCodec.cpp +++ b/SkLibGifCodec.cpp
@@ -415,7 +415,7 @@ const int xBegin = frameContext->xOffset(); const int yBegin = frameContext->yOffset() + rowNumber; const int xEnd = std::min(xBegin + width, this->dimensions().width()); - const int yEnd = std::min(yBegin + rowNumber + repeatCount, this->dimensions().height()); + const int yEnd = std::min(yBegin + repeatCount, this->dimensions().height()); // FIXME: No need to make the checks on width/xBegin/xEnd for every row. We could instead do // this once in prepareToDecode. if (!width || (xBegin < 0) || (yBegin < 0) || (xEnd <= xBegin) || (yEnd <= yBegin))