summaryrefslogtreecommitdiff
path: root/vp9/ratectrl_rtc.cc
diff options
context:
space:
mode:
Diffstat (limited to 'vp9/ratectrl_rtc.cc')
-rw-r--r--vp9/ratectrl_rtc.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/vp9/ratectrl_rtc.cc b/vp9/ratectrl_rtc.cc
index 76ff367c0..f4d7f7e9e 100644
--- a/vp9/ratectrl_rtc.cc
+++ b/vp9/ratectrl_rtc.cc
@@ -25,7 +25,10 @@ std::unique_ptr<VP9RateControlRTC> VP9RateControlRTC::Create(
VP9RateControlRTC());
if (!rc_api) return nullptr;
rc_api->cpi_ = static_cast<VP9_COMP *>(vpx_memalign(32, sizeof(*cpi_)));
- if (!rc_api->cpi_) return nullptr;
+ if (!rc_api->cpi_) {
+ rc_api.reset();
+ return nullptr;
+ }
vp9_zero(*rc_api->cpi_);
rc_api->InitRateControl(cfg);
@@ -34,6 +37,10 @@ std::unique_ptr<VP9RateControlRTC> VP9RateControlRTC::Create(
cpi->segmentation_map = static_cast<uint8_t *>(
vpx_calloc(cpi->common.mi_rows * cpi->common.mi_cols,
sizeof(*cpi->segmentation_map)));
+ if (!cpi->segmentation_map) {
+ rc_api.reset();
+ return nullptr;
+ }
cpi->cyclic_refresh =
vp9_cyclic_refresh_alloc(cpi->common.mi_rows, cpi->common.mi_cols);
cpi->cyclic_refresh->content_mode = 0;