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

Unified Diff: src/pdf/SkPDFFont.cpp

Issue 2332813002: SkPDF: do not assert when openStream return nullptr (Closed)
Patch Set: Created 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFFont.cpp
diff --git a/src/pdf/SkPDFFont.cpp b/src/pdf/SkPDFFont.cpp
index 6c37e4cde2ccc946d54ef219bce5f83790423daf..6871635da2845600f5ad43f2039cc2c7a2ce5e78 100644
--- a/src/pdf/SkPDFFont.cpp
+++ b/src/pdf/SkPDFFont.cpp
@@ -368,9 +368,11 @@ void SkPDFType0Font::getFontSubset(SkPDFCanon* canon) {
int ttcIndex;
std::unique_ptr<SkStreamAsset> fontAsset(face->openStream(&ttcIndex));
size_t fontSize = fontAsset ? fontAsset->getLength() : 0;
- SkASSERT(fontAsset);
- SkASSERT(fontSize > 0);
- if (fontSize > 0) {
+ if (0 == fontSize) {
+ SkDebugf("Error: (SkTypeface)(%p)::openStream() returned "
+ "empty stream (%p) when identified as kType1CID_Font "
+ "or kTrueType_Font.\n", face, fontAsset.get());
+ } else {
switch (type) {
case SkAdvancedTypefaceMetrics::kTrueType_Font: {
#ifdef SK_PDF_USE_SFNTLY
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698