summaryrefslogtreecommitdiffstats
path: root/media/jni/android_media_MediaExtractor.cpp
diff options
context:
space:
mode:
authorChong Zhang <chz@google.com>2015-05-14 21:29:50 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-05-14 21:29:52 +0000
commit7fc802bbf750a8ed6be0e1858ebcf9740dda15cb (patch)
treef83ee0805274bca1da2eced9f00071505bf07de3 /media/jni/android_media_MediaExtractor.cpp
parent51bf5d9c078a57b52da786979103674588c2116c (diff)
parentbc10185fa1669a151568feb72277785d323fc344 (diff)
downloadframeworks_base-7fc802bbf750a8ed6be0e1858ebcf9740dda15cb.zip
frameworks_base-7fc802bbf750a8ed6be0e1858ebcf9740dda15cb.tar.gz
frameworks_base-7fc802bbf750a8ed6be0e1858ebcf9740dda15cb.tar.bz2
Merge "MediaDataSource: address API council comments" into mnc-dev
Diffstat (limited to 'media/jni/android_media_MediaExtractor.cpp')
-rw-r--r--media/jni/android_media_MediaExtractor.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/media/jni/android_media_MediaExtractor.cpp b/media/jni/android_media_MediaExtractor.cpp
index b6b7a80..4e9b726 100644
--- a/media/jni/android_media_MediaExtractor.cpp
+++ b/media/jni/android_media_MediaExtractor.cpp
@@ -715,6 +715,11 @@ static void android_media_MediaExtractor_setDataSourceCallback(
status_t err = extractor->setDataSource(bridge);
if (err != OK) {
+ // Clear bridge so that JMediaDataSource::close() is called _before_
+ // we throw the IOException.
+ // Otherwise close() gets called when we go out of scope, it calls
+ // Java with a pending exception and crashes the process.
+ bridge.clear();
jniThrowException(
env,
"java/io/IOException",