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

Unified Diff: src/ports/SkFontMgr_win_dw.cpp

Issue 2046563007: fix null check bugs found by µmix static analyzer (Closed) Base URL: https://skia.googlesource.com/skia@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
Index: src/ports/SkFontMgr_win_dw.cpp
diff --git a/src/ports/SkFontMgr_win_dw.cpp b/src/ports/SkFontMgr_win_dw.cpp
index e6e52d961ad9d62a5e318b941a5d52248a060971..bacac2ceef63154714fc1adc85bcb70b83f559f1 100644
--- a/src/ports/SkFontMgr_win_dw.cpp
+++ b/src/ports/SkFontMgr_win_dw.cpp
@@ -45,7 +45,7 @@ public:
// Takes ownership of stream.
static HRESULT Create(SkStreamAsset* stream, StreamFontFileLoader** streamFontFileLoader) {
*streamFontFileLoader = new StreamFontFileLoader(stream);
- if (nullptr == streamFontFileLoader) {
+ if (nullptr == *streamFontFileLoader) {
return E_OUTOFMEMORY;
}
return S_OK;
@@ -110,7 +110,7 @@ public:
static HRESULT Create(IDWriteFactory* factory, IDWriteFontFileLoader* fontFileLoader,
StreamFontFileEnumerator** streamFontFileEnumerator) {
*streamFontFileEnumerator = new StreamFontFileEnumerator(factory, fontFileLoader);
reed1 2016/06/08 10:35:10 This seems like a crazy test in the first place --
- if (nullptr == streamFontFileEnumerator) {
+ if (nullptr == *streamFontFileEnumerator) {
return E_OUTOFMEMORY;
}
return S_OK;
@@ -207,7 +207,7 @@ public:
static HRESULT Create(IDWriteFontFileLoader* fontFileLoader,
StreamFontCollectionLoader** streamFontCollectionLoader) {
*streamFontCollectionLoader = new StreamFontCollectionLoader(fontFileLoader);
- if (nullptr == streamFontCollectionLoader) {
+ if (nullptr == *streamFontCollectionLoader) {
return E_OUTOFMEMORY;
}
return S_OK;

Powered by Google App Engine
This is Rietveld 408576698