Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Unified Diff: src/codec/SkWebpCodec.cpp

Issue 1196643002: Prevent webp from producing 0 dimensional images (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698