summaryrefslogtreecommitdiff
path: root/vp9/vp9_dx_iface.c
diff options
context:
space:
mode:
authorJames Zern <jzern@google.com>2022-04-18 19:07:39 -0700
committerJames Zern <jzern@google.com>2022-04-18 19:14:30 -0700
commit6ea4ef1d24f84d131e0a4398bf358bfd79bc88c3 (patch)
treefa263f012e5efed466f26ffb37acaad7b14739a1 /vp9/vp9_dx_iface.c
parentf1d42a92bbb98ab4481f85716339a96914369e6a (diff)
downloadlibvpx-6ea4ef1d24f84d131e0a4398bf358bfd79bc88c3.tar.gz
vp9_dx_iface,init_buffer_callbacks: return on alloc failure
use an error code as a jmp target is not currently set in init_decoder() Change-Id: If7798039439f13c739298a8a92a55aaa24e2210c
Diffstat (limited to 'vp9/vp9_dx_iface.c')
-rw-r--r--vp9/vp9_dx_iface.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/vp9/vp9_dx_iface.c b/vp9/vp9_dx_iface.c
index 35ecbaff3..3c42c7dfe 100644
--- a/vp9/vp9_dx_iface.c
+++ b/vp9/vp9_dx_iface.c
@@ -201,7 +201,7 @@ static vpx_codec_err_t update_error_state(
return error->error_code;
}
-static void init_buffer_callbacks(vpx_codec_alg_priv_t *ctx) {
+static vpx_codec_err_t init_buffer_callbacks(vpx_codec_alg_priv_t *ctx) {
VP9_COMMON *const cm = &ctx->pbi->common;
BufferPool *const pool = cm->buffer_pool;
@@ -217,12 +217,16 @@ static void init_buffer_callbacks(vpx_codec_alg_priv_t *ctx) {
pool->get_fb_cb = vp9_get_frame_buffer;
pool->release_fb_cb = vp9_release_frame_buffer;
- if (vp9_alloc_internal_frame_buffers(&pool->int_frame_buffers))
+ if (vp9_alloc_internal_frame_buffers(&pool->int_frame_buffers)) {
vpx_internal_error(&cm->error, VPX_CODEC_MEM_ERROR,
"Failed to initialize internal frame buffers");
+ return VPX_CODEC_MEM_ERROR;
+ }
pool->cb_priv = &pool->int_frame_buffers;
}
+
+ return VPX_CODEC_OK;
}
static void set_default_ppflags(vp8_postproc_cfg_t *cfg) {
@@ -278,9 +282,7 @@ static vpx_codec_err_t init_decoder(vpx_codec_alg_priv_t *ctx) {
if (!ctx->postproc_cfg_set && (ctx->base.init_flags & VPX_CODEC_USE_POSTPROC))
set_default_ppflags(&ctx->postproc_cfg);
- init_buffer_callbacks(ctx);
-
- return VPX_CODEC_OK;
+ return init_buffer_callbacks(ctx);
}
static INLINE void check_resync(vpx_codec_alg_priv_t *const ctx,