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

Unified Diff: src/core/SkMallocPixelRef.cpp

Issue 871993003: check for too-large rowBytes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 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 | « no previous file | tests/BitmapTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkMallocPixelRef.cpp
diff --git a/src/core/SkMallocPixelRef.cpp b/src/core/SkMallocPixelRef.cpp
index f4ba969662589131351aa7efa6141a1f9b53267b..e0d937ec113e5bde15b9a0456b31edf2a9039513 100644
--- a/src/core/SkMallocPixelRef.cpp
+++ b/src/core/SkMallocPixelRef.cpp
@@ -56,8 +56,8 @@ SkMallocPixelRef* SkMallocPixelRef::NewAllocate(const SkImageInfo& info,
return NULL;
}
- int32_t minRB = SkToS32(info.minRowBytes());
- if (minRB < 0) {
+ int64_t minRB = info.minRowBytes64();
caryclark 2015/01/23 15:10:09 signature returns uint64_t
reed1 2015/01/23 15:35:39 trying a cast instead, to stay consistent with the
+ if (!sk_64_isS32(minRB)) {
caryclark 2015/01/23 15:10:10 ... then this would need to be sk_64_asS32(uint64_
return NULL; // allocation will be too large
}
if (requestedRowBytes > 0 && (int32_t)requestedRowBytes < minRB) {
« no previous file with comments | « no previous file | tests/BitmapTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698