Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(692)

Unified Diff: src/images/SkScaledBitmapSampler.cpp

Issue 1085253002: SkScaledBitmapSampler: fix memory overwritten (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/images/SkScaledBitmapSampler.cpp
diff --git a/src/images/SkScaledBitmapSampler.cpp b/src/images/SkScaledBitmapSampler.cpp
index a040329965ebac19314e3a0b9d15dee8c91323d4..f79eb6f905f110703810786302e207d8fc380e6a 100644
--- a/src/images/SkScaledBitmapSampler.cpp
+++ b/src/images/SkScaledBitmapSampler.cpp
@@ -762,7 +762,9 @@ bool SkScaledBitmapSampler::sampleInterlaced(const uint8_t* SK_RESTRICT src, int
// of the destination bitmap's pixels, which is used to calculate the destination row
// each time this function is called.
const int dstY = srcYMinusY0 / fDY;
- SkASSERT(dstY < fScaledHeight);
+ if (dstY >= fScaledHeight) {
+ return false;
+ }
char* dstRow = fDstRow + dstY * fDstRowBytes;
return fRowProc(dstRow, src + fX0 * fSrcPixelSize, fScaledWidth,
fDX * fSrcPixelSize, dstY, fCTable);
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698