diff options
author | James Zern <jzern@google.com> | 2016-02-17 14:55:50 -0800 |
---|---|---|
committer | James Zern <jzern@google.com> | 2016-02-17 18:04:14 -0800 |
commit | 61b112b67b73c86a5617f1c6b8e33f3fe0d5be1b (patch) | |
tree | 9a50cc797654be200347da9e38a0de9d18196260 /vp8/encoder/onyx_if.c | |
parent | a3d23877f6a99cecd5a849d8b915b5dfc16cd34a (diff) | |
download | libvpx-61b112b67b73c86a5617f1c6b8e33f3fe0d5be1b.tar libvpx-61b112b67b73c86a5617f1c6b8e33f3fe0d5be1b.tar.gz libvpx-61b112b67b73c86a5617f1c6b8e33f3fe0d5be1b.tar.bz2 libvpx-61b112b67b73c86a5617f1c6b8e33f3fe0d5be1b.zip |
vp8/onyx_if: add missing alloc checks
Change-Id: I9b0aa340518f45e16fa9754afd87347aabf968d7
Diffstat (limited to 'vp8/encoder/onyx_if.c')
-rw-r--r-- | vp8/encoder/onyx_if.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c index 5a4b37dcf..93c457008 100644 --- a/vp8/encoder/onyx_if.c +++ b/vp8/encoder/onyx_if.c @@ -1318,9 +1318,11 @@ void vp8_alloc_compressor_data(VP8_COMP *cpi) #if CONFIG_TEMPORAL_DENOISING if (cpi->oxcf.noise_sensitivity > 0) { vp8_denoiser_free(&cpi->denoiser); - vp8_denoiser_allocate(&cpi->denoiser, width, height, - cm->mb_rows, cm->mb_cols, - cpi->oxcf.noise_sensitivity); + if (vp8_denoiser_allocate(&cpi->denoiser, width, height, + cm->mb_rows, cm->mb_cols, + cpi->oxcf.noise_sensitivity)) + vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR, + "Failed to allocate denoiser"); } #endif } @@ -1832,9 +1834,11 @@ void vp8_change_config(VP8_COMP *cpi, VP8_CONFIG *oxcf) { int width = (cpi->oxcf.Width + 15) & ~15; int height = (cpi->oxcf.Height + 15) & ~15; - vp8_denoiser_allocate(&cpi->denoiser, width, height, - cm->mb_rows, cm->mb_cols, - cpi->oxcf.noise_sensitivity); + if (vp8_denoiser_allocate(&cpi->denoiser, width, height, + cm->mb_rows, cm->mb_cols, + cpi->oxcf.noise_sensitivity)) + vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR, + "Failed to allocate denoiser"); } } #endif |