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

Unified Diff: include/core/SkImageInfo.h

Issue 1169553003: add callbacks to Images that wrap client-provided content (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: privatize Created 5 years, 6 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 | « include/core/SkImage.h ('k') | include/gpu/GrSurface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkImageInfo.h
diff --git a/include/core/SkImageInfo.h b/include/core/SkImageInfo.h
index daa50dcdb22a28fae6d4182dbe595471a0786e44..9a1ea5f5ee90d2e107a5e60b335df8dfb1be60c7 100644
--- a/include/core/SkImageInfo.h
+++ b/include/core/SkImageInfo.h
@@ -282,7 +282,11 @@ public:
}
size_t getSafeSize(size_t rowBytes) const {
- return (size_t)this->getSafeSize64(rowBytes);
+ int64_t size = this->getSafeSize64(rowBytes);
+ if (!sk_64_isS32(size)) {
+ return 0;
+ }
+ return sk_64_asS32(size);
}
bool validRowBytes(size_t rowBytes) const {
« no previous file with comments | « include/core/SkImage.h ('k') | include/gpu/GrSurface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698