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

Unified Diff: src/core/SkBitmap.cpp

Issue 2104973003: Address two fuzzer bugs (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 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 | src/core/SkPicturePlayback.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBitmap.cpp
diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp
index 8cb8e4d6fc9f530c290c8fc86477572a6406e592..863169c458b8d76642d3aae13e923c68cb90ede3 100644
--- a/src/core/SkBitmap.cpp
+++ b/src/core/SkBitmap.cpp
@@ -1145,8 +1145,10 @@ bool SkBitmap::ReadRawPixels(SkReadBuffer* buffer, SkBitmap* bitmap) {
SkImageInfo info;
info.unflatten(*buffer);
- // If there was an error reading "info", don't use it to compute minRowBytes()
- if (!buffer->validate(true)) {
+ // If there was an error reading "info" or if it is bogus,
+ // don't use it to compute minRowBytes()
+ if (!buffer->validate(SkColorTypeValidateAlphaType(info.colorType(),
+ info.alphaType()))) {
return false;
}
« no previous file with comments | « no previous file | src/core/SkPicturePlayback.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698