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

Unified Diff: src/core/SkPicturePlayback.cpp

Issue 41253002: Checking structure sizes before reading them from memory to avoid overflowing the buffer's stream. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Adding validation before memory allocation in SkRegion::readFromMemory Created 7 years, 1 month 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
Index: src/core/SkPicturePlayback.cpp
diff --git a/src/core/SkPicturePlayback.cpp b/src/core/SkPicturePlayback.cpp
index f2d959d3d6c8bb5d11af8a69f48a2acad892bab2..5a016d48d61ac1b09eb6ba73576088b170bf2fad 100644
--- a/src/core/SkPicturePlayback.cpp
+++ b/src/core/SkPicturePlayback.cpp
@@ -997,7 +997,8 @@ void SkPicturePlayback::draw(SkCanvas& canvas, SkDrawPictureCallback* callback)
case DRAW_RRECT: {
const SkPaint& paint = *getPaint(reader);
SkRRect rrect;
- canvas.drawRRect(*reader.readRRect(&rrect), paint);
+ reader.readRRect(&rrect);
+ canvas.drawRRect(rrect, paint);
} break;
case DRAW_SPRITE: {
const SkPaint* paint = getPaint(reader);
« no previous file with comments | « src/core/SkPath.cpp ('k') | src/core/SkRRect.cpp » ('j') | tests/SerializationTest.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698