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

Side by Side Diff: src/utils/win/SkDWriteFontFileStream.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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 #include "SkTypes.h" 7 #include "SkTypes.h"
8 #if defined(SK_BUILD_FOR_WIN32) 8 #if defined(SK_BUILD_FOR_WIN32)
9 9
10 #include "SkTypes.h" 10 #include "SkTypes.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 return fLockedMemory; 132 return fLockedMemory;
133 } 133 }
134 134
135 /////////////////////////////////////////////////////////////////////////////// 135 ///////////////////////////////////////////////////////////////////////////////
136 // SkIDWriteFontFileStreamWrapper 136 // SkIDWriteFontFileStreamWrapper
137 137
138 HRESULT SkDWriteFontFileStreamWrapper::Create(SkStreamAsset* stream, 138 HRESULT SkDWriteFontFileStreamWrapper::Create(SkStreamAsset* stream,
139 SkDWriteFontFileStreamWrapper** st reamFontFileStream) 139 SkDWriteFontFileStreamWrapper** st reamFontFileStream)
140 { 140 {
141 *streamFontFileStream = new SkDWriteFontFileStreamWrapper(stream); 141 *streamFontFileStream = new SkDWriteFontFileStreamWrapper(stream);
142 if (nullptr == streamFontFileStream) { 142 if (nullptr == *streamFontFileStream) {
reed1 2016/06/08 10:35:10 We NEVER assume 'new' will return nullptr. Can we
143 return E_OUTOFMEMORY; 143 return E_OUTOFMEMORY;
144 } 144 }
145 return S_OK; 145 return S_OK;
146 } 146 }
147 147
148 SkDWriteFontFileStreamWrapper::SkDWriteFontFileStreamWrapper(SkStreamAsset* stre am) 148 SkDWriteFontFileStreamWrapper::SkDWriteFontFileStreamWrapper(SkStreamAsset* stre am)
149 : fRefCount(1), fStream(stream) { 149 : fRefCount(1), fStream(stream) {
150 } 150 }
151 151
152 HRESULT STDMETHODCALLTYPE SkDWriteFontFileStreamWrapper::QueryInterface(REFIID i id, void** ppvObject) { 152 HRESULT STDMETHODCALLTYPE SkDWriteFontFileStreamWrapper::QueryInterface(REFIID i id, void** ppvObject) {
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 return S_OK; 226 return S_OK;
227 } 227 }
228 228
229 HRESULT STDMETHODCALLTYPE SkDWriteFontFileStreamWrapper::GetLastWriteTime(UINT64 * lastWriteTime) { 229 HRESULT STDMETHODCALLTYPE SkDWriteFontFileStreamWrapper::GetLastWriteTime(UINT64 * lastWriteTime) {
230 // The concept of last write time does not apply to this loader. 230 // The concept of last write time does not apply to this loader.
231 *lastWriteTime = 0; 231 *lastWriteTime = 0;
232 return E_NOTIMPL; 232 return E_NOTIMPL;
233 } 233 }
234 234
235 #endif//defined(SK_BUILD_FOR_WIN32) 235 #endif//defined(SK_BUILD_FOR_WIN32)
OLDNEW
« src/ports/SkFontMgr_win_dw.cpp ('K') | « src/ports/SkFontMgr_win_dw.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698