Chromium Code Reviews| Index: src/codec/SkWebpCodec.cpp |
| diff --git a/src/codec/SkWebpCodec.cpp b/src/codec/SkWebpCodec.cpp |
| index b02015c7a7684ca10ae9ce802762c104feab954a..818c64db493a68c3e6c6b88d8af65d6503a958ae 100644 |
| --- a/src/codec/SkWebpCodec.cpp |
| +++ b/src/codec/SkWebpCodec.cpp |
| @@ -103,8 +103,8 @@ static bool conversion_possible(const SkImageInfo& dst, const SkImageInfo& src) |
| SkISize SkWebpCodec::onGetScaledDimensions(float desiredScale) const { |
| SkISize dim = this->getInfo().dimensions(); |
| - dim.fWidth = SkScalarRoundToInt(desiredScale * dim.fWidth); |
| - dim.fHeight = SkScalarRoundToInt(desiredScale * dim.fHeight); |
| + dim.fWidth = SkTMax(1, SkScalarRoundToInt(desiredScale * dim.fWidth)); |
|
scroggo
2015/06/19 14:19:51
Maybe add a comment explaining our decision (on th
msarett
2015/06/19 14:28:45
Done.
|
| + dim.fHeight = SkTMax(1, SkScalarRoundToInt(desiredScale * dim.fHeight)); |
| return dim; |
| } |