Index: tests/StreamTest.cpp |
diff --git a/tests/StreamTest.cpp b/tests/StreamTest.cpp |
index 776c2010145e15579064fb2431ee0b35b4097e89..3641f3b8241babe008b83b55b26bf2657139e044 100644 |
--- a/tests/StreamTest.cpp |
+++ b/tests/StreamTest.cpp |
@@ -259,6 +259,9 @@ DEF_TEST(StreamPeek, reporter) { |
// Test an arbitrary file stream. file streams do not support peeking. |
SkFILEStream fileStream(GetResourcePath("baby_tux.webp").c_str()); |
REPORTER_ASSERT(reporter, fileStream.isValid()); |
+ if (!fileStream.isValid()) { |
+ return; |
+ } |
SkAutoMalloc storage(fileStream.getLength()); |
for (size_t i = 1; i < fileStream.getLength(); i++) { |
REPORTER_ASSERT(reporter, !fileStream.peek(storage.get(), i)); |