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

Unified Diff: src/codec/SkCodec_libbmp.cpp

Issue 1091043003: Ensure that we create a NULL codec for images with zero dimensions (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 8 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 | « resources/empty_images/zero-width.wbmp ('k') | tests/CodexTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkCodec_libbmp.cpp
diff --git a/src/codec/SkCodec_libbmp.cpp b/src/codec/SkCodec_libbmp.cpp
index 56663f84ee3b871fcb50fedc33c41af1aec4dd96..7586217d54d843ea795f9874f83a31b9f4289db7 100644
--- a/src/codec/SkCodec_libbmp.cpp
+++ b/src/codec/SkCodec_libbmp.cpp
@@ -319,9 +319,9 @@ bool SkBmpCodec::ReadHeader(SkStream* stream, bool isIco, SkCodec** codecOut) {
if (isIco) {
height /= 2;
}
- static const int kBmpMaxDim = 1 << 16;
- if (width < 0 || width >= kBmpMaxDim || height >= kBmpMaxDim) {
- // TODO: Decide if we want to support really large bmps.
+ if (width <= 0 || height <= 0) {
+ // TODO: Decide if we want to disable really large bmps as well.
+ // https://code.google.com/p/skia/issues/detail?id=3617
SkCodecPrintf("Error: invalid bitmap dimensions.\n");
return false;
}
« no previous file with comments | « resources/empty_images/zero-width.wbmp ('k') | tests/CodexTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698