diff --git a/frameworks/kitsimpl/js/avcodec/video_decoder/video_decoder_napi.cpp b/frameworks/kitsimpl/js/avcodec/video_decoder/video_decoder_napi.cpp index 89ca94a2ef1fb1a8df0c8d40fb465f4fb6b596e0..d903e7963f58b413408d33e43492a111bc16d4a7 100644 --- a/frameworks/kitsimpl/js/avcodec/video_decoder/video_decoder_napi.cpp +++ b/frameworks/kitsimpl/js/avcodec/video_decoder/video_decoder_napi.cpp @@ -624,6 +624,11 @@ napi_value VideoDecoderNapi::ReleaseOutput(napi_env env, napi_callback_info info (void)napi_unwrap(env, jsThis, reinterpret_cast(&asyncCtx->napi)); + if (asyncCtx->napi->codecHelper_->IsStop() || asyncCtx->napi->codecHelper_->IsFlushing()) { + MEDIA_LOGD("Stop already or flushing, release output failed"); + return result; + } + if (asyncCtx->napi->vdec_->ReleaseOutputBuffer(asyncCtx->index, asyncCtx->isRender) != MSERR_OK) { asyncCtx->SignError(MSERR_EXT_UNKNOWN, "Failed to ReleaseOutput"); }