diff options
author | James Dong <jdong@google.com> | 2010-02-04 18:08:06 -0800 |
---|---|---|
committer | James Dong <jdong@google.com> | 2010-02-04 18:11:32 -0800 |
commit | e4cfcb82a86e1546474c3fd25101ab561063a1bd (patch) | |
tree | 66b79cca30bd18ba9e56648567d35b330e364db7 /cmds/stagefright/record.cpp | |
parent | 09922d855bd008f58214e4c1a905263129a924a3 (diff) | |
download | frameworks_base-e4cfcb82a86e1546474c3fd25101ab561063a1bd.zip frameworks_base-e4cfcb82a86e1546474c3fd25101ab561063a1bd.tar.gz frameworks_base-e4cfcb82a86e1546474c3fd25101ab561063a1bd.tar.bz2 |
When the extractor is not able to be created successfully, don't crash
Diffstat (limited to 'cmds/stagefright/record.cpp')
-rw-r--r-- | cmds/stagefright/record.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/cmds/stagefright/record.cpp b/cmds/stagefright/record.cpp index 2ec0b70..845c854 100644 --- a/cmds/stagefright/record.cpp +++ b/cmds/stagefright/record.cpp @@ -106,6 +106,9 @@ sp<MediaSource> createSource(const char *filename) { sp<MediaExtractor> extractor = MediaExtractor::Create(new FileSource(filename)); + if (extractor == NULL) { + return NULL; + } size_t num_tracks = extractor->countTracks(); |