Skip to content

Commit d932de9

Browse files
mstorsjotheandi666
authored andcommitted
mediacodec: Don't crash if trying to open a codec that does not exist
Change-Id: If75e3156517993629f50622a84a9ac573fced815
1 parent b529e4c commit d932de9

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

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)