mediacodec: Don't crash if trying to open a codec that does not exist

Change-Id: If75e3156517993629f50622a84a9ac573fced815
This commit is contained in:
Martin Storsjo
2012-07-13 13:01:06 +03:00
committed by Andreas Huber
parent b529e4c9ca
commit d932de9aff

View File

@@ -96,7 +96,10 @@ status_t JMediaCodec::initCheck() const {
}
JMediaCodec::~JMediaCodec() {
mCodec->release();
if (mCodec != NULL) {
mCodec->release();
mCodec.clear();
}
JNIEnv *env = AndroidRuntime::getJNIEnv();