Don't crash when resource path is omitted
TBR=reed@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1840573004 Review URL: https://codereview.chromium.org/1840573004 .
This commit is contained in:
parent
fdc88b5aa6
commit
92271fc314
@ -24,6 +24,9 @@ static bool almost_equal(float a, float b) {
|
||||
DEF_TEST(ColorSpaceParsePngICCProfile, r) {
|
||||
SkAutoTDelete<SkStream> stream(resource("color_wheel_with_profile.png"));
|
||||
REPORTER_ASSERT(r, nullptr != stream);
|
||||
if (!stream) {
|
||||
return;
|
||||
}
|
||||
|
||||
SkAutoTDelete<SkCodec> codec(SkCodec::NewFromStream(stream.release()));
|
||||
REPORTER_ASSERT(r, nullptr != codec);
|
||||
|
@ -17,6 +17,10 @@ static SkStreamAsset* resource(const char path[]) {
|
||||
DEF_TEST(ExifOrientation, r) {
|
||||
SkAutoTDelete<SkStream> stream(resource("exif-orientation-2-ur.jpg"));
|
||||
REPORTER_ASSERT(r, nullptr != stream);
|
||||
if (!stream) {
|
||||
return;
|
||||
}
|
||||
|
||||
SkAutoTDelete<SkCodec> codec(SkCodec::NewFromStream(stream.release()));
|
||||
REPORTER_ASSERT(r, nullptr != codec);
|
||||
SkCodec::Origin origin = codec->getOrigin();
|
||||
|
Loading…
Reference in New Issue
Block a user