aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2009-07-07 21:18:10 +0000
committerGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2009-07-07 21:18:10 +0000
commit9dc5465c1c5cc11f72ddb0419da1964bc865c26f (patch)
tree3672d9489aa8480bbb256ee43f82f24d6912a985
parent6189877c50166f58f09c6583a9aa37c735310779 (diff)
check if the encoder factory returned null
git-svn-id: http://skia.googlecode.com/svn/trunk@255 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--samplecode/SampleEncode.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/samplecode/SampleEncode.cpp b/samplecode/SampleEncode.cpp
index 2730ecef60..b09b2ebef6 100644
--- a/samplecode/SampleEncode.cpp
+++ b/samplecode/SampleEncode.cpp
@@ -128,7 +128,8 @@ public:
remove(path.c_str());
SkImageEncoder* codec = SkImageEncoder::Create(gTypes[j]);
- if (!codec->encodeFile(path.c_str(), fBitmaps[i], 100)) {
+ if (NULL == codec ||
+ !codec->encodeFile(path.c_str(), fBitmaps[i], 100)) {
SkDebugf("------ failed to encode %s\n", path.c_str());
remove(path.c_str()); // remove any partial file
}