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/SkRecordDraw.cpp

Issue 1504313005: fix a couple flaky nonnull attribute ubsan warnings (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years 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 | « include/core/SkTypes.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkRecordDraw.cpp
diff --git a/src/core/SkRecordDraw.cpp b/src/core/SkRecordDraw.cpp
index 4847273f52a826f4eb2510abb75b4e7860cc82d2..b9bf92c0bad77b9a73ff7711d7e24b905e822491 100644
--- a/src/core/SkRecordDraw.cpp
+++ b/src/core/SkRecordDraw.cpp
@@ -693,7 +693,8 @@ private:
// Store 'saveLayer ops from enclosing picture' + drawPict op + 'ops from sub-picture'
dst.fKeySize = fSaveLayerOpStack.count() + src.fKeySize + 1;
dst.fKey = new int[dst.fKeySize];
- memcpy(dst.fKey, fSaveLayerOpStack.begin(), fSaveLayerOpStack.count() * sizeof(int));
+ sk_careful_memcpy(dst.fKey, fSaveLayerOpStack.begin(),
+ fSaveLayerOpStack.count() * sizeof(int));
dst.fKey[fSaveLayerOpStack.count()] = fFillBounds.currentOp();
memcpy(&dst.fKey[fSaveLayerOpStack.count()+1], src.fKey, src.fKeySize * sizeof(int));
}
« no previous file with comments | « include/core/SkTypes.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698