| Index: dm/DMSrcSink.cpp
|
| diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
|
| index 88371a8e28fdf68e1e0e5e041588a3a475e4adc1..23f42af133942d29608819584c32c2f344f38401 100644
|
| --- a/dm/DMSrcSink.cpp
|
| +++ b/dm/DMSrcSink.cpp
|
| @@ -86,7 +86,7 @@ static SkBitmapRegionDecoderInterface* create_brd(Path path,
|
| SkBitmapRegionDecoderInterface::Strategy strategy) {
|
| SkAutoTUnref<SkData> encoded(SkData::NewFromFileName(path.c_str()));
|
| if (!encoded) {
|
| - return NULL;
|
| + return nullptr;
|
| }
|
| return SkBitmapRegionDecoderInterface::CreateBitmapRegionDecoder(new SkMemoryStream(encoded),
|
| strategy);
|
| @@ -114,6 +114,10 @@ Error BRDSrc::draw(SkCanvas* canvas) const {
|
| return Error::Nonfatal(SkStringPrintf("Could not create brd for %s.", fPath.c_str()));
|
| }
|
|
|
| + if (!brd->conversionSupported(colorType)) {
|
| + return Error::Nonfatal("Cannot convert to color type.\n");
|
| + }
|
| +
|
| const uint32_t width = brd->width();
|
| const uint32_t height = brd->height();
|
| // Visually inspecting very small output images is not necessary.
|
| @@ -244,7 +248,7 @@ Error CodecSrc::draw(SkCanvas* canvas) const {
|
| if (!encoded) {
|
| return SkStringPrintf("Couldn't read %s.", fPath.c_str());
|
| }
|
| - SkAutoTDelete<SkCodec> codec(NULL);
|
| + SkAutoTDelete<SkCodec> codec(nullptr);
|
| if (kScaledCodec_Mode == fMode) {
|
| codec.reset(SkScaledCodec::NewFromData(encoded));
|
| // TODO (msarett): This should fall through to a fatal error once we support scaled
|
|
|