aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2016-11-09 08:03:21 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-11-09 13:40:11 +0000
commit68b7a52a0b9355b357d4bd72bca479916d115d7c (patch)
tree7b32b3ab426d7a361f25c4c32a9a83c37c88954f /src
parent3743013f755d23c215d852af7d829c3cd74f34a2 (diff)
Fix fuzzer bug
BUG=663687 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4580 Change-Id: I9e914a1134b8049cf62bb36d4a6145eb8487d4e6 Reviewed-on: https://skia-review.googlesource.com/4580 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/gpu/GrSurface.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gpu/GrSurface.cpp b/src/gpu/GrSurface.cpp
index f2318793d2..7f571b875f 100644
--- a/src/gpu/GrSurface.cpp
+++ b/src/gpu/GrSurface.cpp
@@ -38,7 +38,7 @@ size_t GrSurface::WorstCaseSize(const GrSurfaceDesc& desc) {
}
SkASSERT(kUnknown_GrPixelConfig != desc.fConfig);
SkASSERT(!GrPixelConfigIsCompressed(desc.fConfig));
- size_t colorBytes = desc.fWidth * desc.fHeight * GrBytesPerPixel(desc.fConfig);
+ size_t colorBytes = (size_t) desc.fWidth * desc.fHeight * GrBytesPerPixel(desc.fConfig);
// This would be a nice assert to have (i.e., we aren't creating 0 width/height surfaces).
// Unfortunately Chromium seems to want to do this.
@@ -50,7 +50,7 @@ size_t GrSurface::WorstCaseSize(const GrSurfaceDesc& desc) {
if (GrPixelConfigIsCompressed(desc.fConfig)) {
size = GrCompressedFormatDataSize(desc.fConfig, desc.fWidth, desc.fHeight);
} else {
- size = desc.fWidth * desc.fHeight * GrBytesPerPixel(desc.fConfig);
+ size = (size_t) desc.fWidth * desc.fHeight * GrBytesPerPixel(desc.fConfig);
}
size += size/3; // in case we have to mipmap
@@ -68,7 +68,7 @@ size_t GrSurface::ComputeSize(const GrSurfaceDesc& desc,
if (GrPixelConfigIsCompressed(desc.fConfig)) {
colorSize = GrCompressedFormatDataSize(desc.fConfig, desc.fWidth, desc.fHeight);
} else {
- colorSize = desc.fWidth * desc.fHeight * GrBytesPerPixel(desc.fConfig);
+ colorSize = (size_t) desc.fWidth * desc.fHeight * GrBytesPerPixel(desc.fConfig);
}
SkASSERT(colorSize > 0);