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

Unified Diff: tests/ColorSpaceTest.cpp

Issue 1838583002: Don't crash when resource path isn't specified (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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: tests/ColorSpaceTest.cpp
diff --git a/tests/ColorSpaceTest.cpp b/tests/ColorSpaceTest.cpp
index 37785e238b8b6c93938e85a8bea7209b6591e2c1..0774a095a7c7f65d6886b55af27a76b883f96653 100644
--- a/tests/ColorSpaceTest.cpp
+++ b/tests/ColorSpaceTest.cpp
@@ -57,9 +57,15 @@ DEF_TEST(ColorSpaceParsePngICCProfile, r) {
DEF_TEST(ColorSpaceParseJpegICCProfile, r) {
SkAutoTDelete<SkStream> stream(resource("icc-v2-gbr.jpg"));
REPORTER_ASSERT(r, nullptr != stream);
+ if (!stream) {
+ return;
+ }
SkAutoTDelete<SkCodec> codec(SkCodec::NewFromStream(stream.release()));
REPORTER_ASSERT(r, nullptr != codec);
+ if (!codec) {
+ return;
+ }
SkColorSpace* colorSpace = codec->getColorSpace();
REPORTER_ASSERT(r, nullptr != colorSpace);
« 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