aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/codec/SkBmpBaseCodec.cpp
Commit message (Collapse)AuthorAge
* begin cleanup of malloc porting layerGravatar Mike Reed2018-01-05
| | | | | | | | | | | | | | 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>
* use unique_ptr for codec factoriesGravatar Mike Reed2017-07-25
| | | | | | | | | | Will need guards for android (at least) Bug: skia: Change-Id: I2bb8e656997984489ef1f2e41cd3d301c4e7b947 Reviewed-on: https://skia-review.googlesource.com/26040 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* Replace BMP calls to new with calls to mallocGravatar Leon Scroggins III2017-06-05
A BMP can have an arbitrarily large width. We typically read a row into a block of memory before swizzling it to the output. Rather than calling new to create that block of memory, which may crash when we run out of memory, call malloc, and return null if malloc fails. Add a common base class for Mask and Standard BMP codecs. This class handles allocating and freeing the buffer. Bug: b/37623797 Change-Id: I0510b76d688d030865faa481bb2fb1351dac2c97 Reviewed-on: https://skia-review.googlesource.com/18400 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>