diff options
author | James Zern <jzern@google.com> | 2022-04-18 19:07:39 -0700 |
---|---|---|
committer | James Zern <jzern@google.com> | 2022-04-18 19:14:30 -0700 |
commit | 6ea4ef1d24f84d131e0a4398bf358bfd79bc88c3 (patch) | |
tree | fa263f012e5efed466f26ffb37acaad7b14739a1 /vp9 | |
parent | f1d42a92bbb98ab4481f85716339a96914369e6a (diff) | |
download | libvpx-6ea4ef1d24f84d131e0a4398bf358bfd79bc88c3.tar libvpx-6ea4ef1d24f84d131e0a4398bf358bfd79bc88c3.tar.gz libvpx-6ea4ef1d24f84d131e0a4398bf358bfd79bc88c3.tar.bz2 libvpx-6ea4ef1d24f84d131e0a4398bf358bfd79bc88c3.zip |
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')
-rw-r--r-- | vp9/vp9_dx_iface.c | 12 |
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, |