summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/omx
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2010-02-04 18:08:06 -0800
committerJames Dong <jdong@google.com>2010-02-04 18:11:32 -0800
commitb93ad64a423975748c7f5e1a5ea94ab8681bc899 (patch)
treeed9b6df646a893ade81f560e90c0dc33adaae132 /media/libstagefright/omx
parentb399aa37056a3ce7a38b4a20cc0aef8e0e01b23e (diff)
downloadframeworks_av-b93ad64a423975748c7f5e1a5ea94ab8681bc899.zip
frameworks_av-b93ad64a423975748c7f5e1a5ea94ab8681bc899.tar.gz
frameworks_av-b93ad64a423975748c7f5e1a5ea94ab8681bc899.tar.bz2
When the extractor is not able to be created successfully, don't crash
Diffstat (limited to 'media/libstagefright/omx')
-rw-r--r--media/libstagefright/omx/tests/OMXHarness.cpp8
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(