Do not crash when the resources are missing

In test_conversion_possible

BUG=skia:5314

Change-Id: Ia0e4178a262820b4161e55e07b0669f18322a64b
Reviewed-on: https://skia-review.googlesource.com/7742
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
This commit is contained in:
Leon Scroggins III 2017-01-30 09:59:28 -05:00 committed by Skia Commit-Bot
parent 3de0aee181
commit c9942a15fa

View File

@ -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;