diff options
author | James Dong <jdong@google.com> | 2010-02-05 12:05:42 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-02-05 12:05:42 -0800 |
commit | 9446c5046872e8ae44120d4057ae724875aba1a4 (patch) | |
tree | 58a95fe37adc5051fc967af6f2ca7b82f0319842 /media | |
parent | 7722abe2591026e7db8910afa0431602723fc1e0 (diff) | |
parent | e4cfcb82a86e1546474c3fd25101ab561063a1bd (diff) | |
download | frameworks_base-9446c5046872e8ae44120d4057ae724875aba1a4.zip frameworks_base-9446c5046872e8ae44120d4057ae724875aba1a4.tar.gz frameworks_base-9446c5046872e8ae44120d4057ae724875aba1a4.tar.bz2 |
Merge "When the extractor is not able to be created successfully, don't crash"
Diffstat (limited to 'media')
-rw-r--r-- | media/libstagefright/omx/tests/OMXHarness.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/media/libstagefright/omx/tests/OMXHarness.cpp b/media/libstagefright/omx/tests/OMXHarness.cpp index 51fcaf5..c05d90a 100644 --- a/media/libstagefright/omx/tests/OMXHarness.cpp +++ b/media/libstagefright/omx/tests/OMXHarness.cpp @@ -512,7 +512,9 @@ static sp<MediaSource> CreateSourceForMime(const char *mime) { sp<MediaExtractor> extractor = CreateExtractorFromURI(url); - CHECK(extractor != NULL); + if (extractor == NULL) { + return NULL; + } for (size_t i = 0; i < extractor->countTracks(); ++i) { sp<MetaData> meta = extractor->getTrackMetaData(i); @@ -571,6 +573,10 @@ status_t Harness::testSeek( sp<MediaSource> source = CreateSourceForMime(mime); sp<MediaSource> seekSource = CreateSourceForMime(mime); + if (source == NULL || seekSource == NULL) { + return UNKNOWN_ERROR; + } + CHECK_EQ(seekSource->start(), OK); sp<MediaSource> codec = OMXCodec::Create( |