ref: a3d23877f6a99cecd5a849d8b915b5dfc16cd34a
parent: fdc977afc6b431c7577e70d151f89ea726bcaf8f
author: James Zern <jzern@google.com>
date: Wed Feb 17 09:54:57 EST 2016
vp8/denoising: add missing alloc check Change-Id: I51ede902cd9d7bafa41f7caa3f9adf77f9df5903
--- a/vp8/encoder/denoising.c
+++ b/vp8/encoder/denoising.c
@@ -440,6 +440,11 @@
denoiser->yv12_last_source.frame_size);
denoiser->denoise_state = vpx_calloc((num_mb_rows * num_mb_cols), 1);
+ if (!denoiser->denoise_state)
+ {
+ vp8_denoiser_free(denoiser);
+ return 1;
+ }
memset(denoiser->denoise_state, 0, (num_mb_rows * num_mb_cols));
vp8_denoiser_set_parameters(denoiser, mode);
denoiser->nmse_source_diff = 0;