Skip to content

Commit 0bf666a

Browse files
Jean-Baptiste QueruAndroid Git Automerger
authored andcommitted
am 4da3769: Merge "mediacodec: Don\'t crash if trying to open a codec that does not exist"
* commit '4da3769d30851f0b517a688a5c835715d7d0b0bf': mediacodec: Don't crash if trying to open a codec that does not exist
2 parents 1ad8bf5 + 4da3769 commit 0bf666a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

media/jni/android_media_MediaCodec.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,10 @@ status_t JMediaCodec::initCheck() const {
9696
}
9797

9898
JMediaCodec::~JMediaCodec() {
99-
mCodec->release();
99+
if (mCodec != NULL) {
100+
mCodec->release();
101+
mCodec.clear();
102+
}
100103

101104
JNIEnv *env = AndroidRuntime::getJNIEnv();
102105

0 commit comments

Comments
 (0)