Call vpx_codec_destroy() only if vpx_codec_init() call preceded.
This fixes the issue when Init() with correct codec settings fails because preceding Init() was called with wrong settings. Bug: webrtc:8969 Change-Id: I50e618af6266ef593942fda27839c7c01e8717ae Reviewed-on: https://webrtc-review.googlesource.com/59382 Reviewed-by: Rasmus Brandt <brandtr@webrtc.org> Commit-Queue: Sergey Silkin <ssilkin@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22271}
This commit is contained in:
committed by
Commit Bot
parent
ede748f14e
commit
9039969de2
@ -279,8 +279,10 @@ int VP8EncoderImpl::Release() {
|
||||
}
|
||||
while (!encoders_.empty()) {
|
||||
vpx_codec_ctx_t& encoder = encoders_.back();
|
||||
if (vpx_codec_destroy(&encoder)) {
|
||||
ret_val = WEBRTC_VIDEO_CODEC_MEMORY;
|
||||
if (inited_) {
|
||||
if (vpx_codec_destroy(&encoder)) {
|
||||
ret_val = WEBRTC_VIDEO_CODEC_MEMORY;
|
||||
}
|
||||
}
|
||||
encoders_.pop_back();
|
||||
}
|
||||
@ -1294,8 +1296,10 @@ int VP8DecoderImpl::Release() {
|
||||
int ret_val = WEBRTC_VIDEO_CODEC_OK;
|
||||
|
||||
if (decoder_ != NULL) {
|
||||
if (vpx_codec_destroy(decoder_)) {
|
||||
ret_val = WEBRTC_VIDEO_CODEC_MEMORY;
|
||||
if (inited_) {
|
||||
if (vpx_codec_destroy(decoder_)) {
|
||||
ret_val = WEBRTC_VIDEO_CODEC_MEMORY;
|
||||
}
|
||||
}
|
||||
delete decoder_;
|
||||
decoder_ = NULL;
|
||||
|
||||
Reference in New Issue
Block a user