| Index: dm/DMSrcSink.cpp
|
| diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
|
| index 30185a2ab1faf8babbb8d720e6ea950c0f5e0718..2c5849a34a5861456d6fa6afa7fe603b72e74431 100644
|
| --- a/dm/DMSrcSink.cpp
|
| +++ b/dm/DMSrcSink.cpp
|
| @@ -430,8 +430,9 @@ Error CodecSrc::draw(SkCanvas* canvas) const {
|
|
|
| switch (fMode) {
|
| case kAnimated_Mode: {
|
| - std::vector<SkCodec::FrameInfo> frameInfos = codec->getFrameInfo();
|
| - if (frameInfos.size() <= 1) {
|
| + std::vector<SkCodec::FrameInfo> frameInfos;
|
| + const bool animated = codec->getFrameInfo(&frameInfos, nullptr);
|
| + if (!animated || frameInfos.size() <= 1) {
|
| return SkStringPrintf("%s is not an animated image.", fPath.c_str());
|
| }
|
|
|
| @@ -725,7 +726,11 @@ SkISize CodecSrc::size() const {
|
| // We'll draw one of each frame, so make it big enough to hold them all
|
| // in a grid. The grid will be roughly square, with "factor" frames per
|
| // row and up to "factor" rows.
|
| - const size_t count = codec->getFrameInfo().size();
|
| + std::vector<SkCodec::FrameInfo> frameInfos;
|
| + if (!codec->getFrameInfo(&frameInfos, nullptr)) {
|
| + return imageSize;
|
| + }
|
| + const size_t count = frameInfos.size();
|
| const float root = sqrt((float) count);
|
| const int factor = sk_float_ceil2int(root);
|
| imageSize.fWidth = imageSize.fWidth * factor;
|
|
|