Skip to content

Commit e683233

Browse files
mstorsjoJean-Baptiste Queru
authored andcommitted
mediacodec: Don't crash if trying to open a codec that does not exist
Change-Id: If75e3156517993629f50622a84a9ac573fced815
1 parent 3754899 commit e683233

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)