aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/codec/SkBmpBaseCodec.cpp
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2018-01-05 11:20:10 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-05 21:29:35 +0000
commit8dc8dbc8211e7b0245a6e7db911265efbe0fccaf (patch)
treef112c74f618a536e86a80d9d657b804a039f3f54 /src/codec/SkBmpBaseCodec.cpp
parentf21b32ccd7bd174ce647078854b2314f8b64d94c (diff)
begin cleanup of malloc porting layer
1. Merge some of the allocators into sk_malloc_flags by redefining a flag to mean zero-init 2. Add more private helpers to simplify our call-sites (and handle some overflow mul checks) 3. The 2-param helpers rely on the saturating SkSafeMath::Mul to pass max_size_t as the request, which should always fail. Bug:508641 Change-Id: I322f1e6ed91113467e0fdb12c91c3dad33d890c8 Reviewed-on: https://skia-review.googlesource.com/90940 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com> Reviewed-by: Stephan Altmueller <stephana@google.com>
Diffstat (limited to 'src/codec/SkBmpBaseCodec.cpp')
-rw-r--r--src/codec/SkBmpBaseCodec.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/codec/SkBmpBaseCodec.cpp b/src/codec/SkBmpBaseCodec.cpp
index 1071ff38e7..c548514057 100644
--- a/src/codec/SkBmpBaseCodec.cpp
+++ b/src/codec/SkBmpBaseCodec.cpp
@@ -13,5 +13,5 @@ SkBmpBaseCodec::SkBmpBaseCodec(int width, int height, const SkEncodedInfo& info,
std::unique_ptr<SkStream> stream,
uint16_t bitsPerPixel, SkCodec::SkScanlineOrder rowOrder)
: INHERITED(width, height, info, std::move(stream), bitsPerPixel, rowOrder)
- , fSrcBuffer(sk_malloc_flags(this->srcRowBytes(), 0))
+ , fSrcBuffer(sk_malloc_canfail(this->srcRowBytes()))
{}