Index: src/animator/SkSnapshot.cpp |
diff --git a/src/animator/SkSnapshot.cpp b/src/animator/SkSnapshot.cpp |
index a253d8e25991d0debaba943c2d39482dc35c59fb..493ce2b3e65a04c7b2610e582fe9ac2354b49593 100644 |
--- a/src/animator/SkSnapshot.cpp |
+++ b/src/animator/SkSnapshot.cpp |
@@ -41,6 +41,10 @@ bool SkSnapshot::draw(SkAnimateMaker& maker) { |
SkASSERT(type >= 0); |
SkASSERT(filename.size() > 0); |
SkImageEncoder* encoder = SkImageEncoder::Create((SkImageEncoder::Type) type); |
+ if (!encoder) { |
+ return false; |
+ } |
+ SkAutoTDelete<SkImageEncoder> ad(encoder); |
SkString name(filename); |
if (sequence) { |