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

Unified Diff: src/core/SkStream.cpp

Issue 1374493002: SkStream: don't segfault on empty asset getMemoryBase(). (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 3 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 | tests/StreamTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkStream.cpp
diff --git a/src/core/SkStream.cpp b/src/core/SkStream.cpp
index 5a66399f5e38a1e1d73b731f7ef1da3747314364..b834513b4f638477c803d5083e1ac4d441f6f9c7 100644
--- a/src/core/SkStream.cpp
+++ b/src/core/SkStream.cpp
@@ -795,7 +795,8 @@ public:
}
const void* getMemoryBase() override {
- if (nullptr == fBlockMemory->fHead->fNext) {
+ if (nullptr != fBlockMemory->fHead &&
+ nullptr == fBlockMemory->fHead->fNext) {
return fBlockMemory->fHead->start();
}
return nullptr;
« no previous file with comments | « no previous file | tests/StreamTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698