aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/CodecTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/CodecTest.cpp')
-rw-r--r--tests/CodecTest.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/CodecTest.cpp b/tests/CodecTest.cpp
index 1ef71b32ad..4083cfa44b 100644
--- a/tests/CodecTest.cpp
+++ b/tests/CodecTest.cpp
@@ -1186,7 +1186,16 @@ static void test_conversion_possible(skiatest::Reporter* r, const char* path,
bool supportsScanlineDecoder,
bool supportsIncrementalDecoder) {
std::unique_ptr<SkStream> stream(GetResourceAsStream(path));
+ if (!stream) {
+ return;
+ }
+
std::unique_ptr<SkCodec> codec(SkCodec::NewFromStream(stream.release()));
+ if (!codec) {
+ ERRORF(r, "failed to create a codec for %s", path);
+ return;
+ }
+
SkImageInfo infoF16 = codec->getInfo().makeColorType(kRGBA_F16_SkColorType);
SkBitmap bm;