diff options
author | James Zern <jzern@google.com> | 2022-04-26 22:19:05 -0700 |
---|---|---|
committer | James Zern <jzern@google.com> | 2022-04-26 22:22:33 -0700 |
commit | c152584107a18a0e240a23279f1f1dfcd80a3acf (patch) | |
tree | 9f5e27bcaaba509ff2394431b1a3400ea8e6b74b | |
parent | e82c5a85c9fcb727a591ffa63fc08bcaf52f9da3 (diff) | |
download | libvpx-c152584107a18a0e240a23279f1f1dfcd80a3acf.tar.gz |
vp9_get_smooth_motion_field: check alloc
Change-Id: I6b19d0169d127f622abf97b3b8590eee957bdc51
-rw-r--r-- | vp9/encoder/vp9_non_greedy_mv.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/vp9/encoder/vp9_non_greedy_mv.c b/vp9/encoder/vp9_non_greedy_mv.c index 1c0d28149..d52801c84 100644 --- a/vp9/encoder/vp9_non_greedy_mv.c +++ b/vp9/encoder/vp9_non_greedy_mv.c @@ -423,6 +423,7 @@ void vp9_get_smooth_motion_field(const MV *search_mf, int row, col; int bw = 4 << b_width_log2_lookup[bsize]; int bh = 4 << b_height_log2_lookup[bsize]; + if (!(input && output)) goto fail; // copy search results to input buffer for (idx = 0; idx < rows * cols; ++idx) { input[idx].row = (float)search_mf[idx].row / bh; @@ -451,6 +452,7 @@ void vp9_get_smooth_motion_field(const MV *search_mf, smooth_mf[idx].row = (int)(input[idx].row * bh); smooth_mf[idx].col = (int)(input[idx].col * bw); } +fail: free(input); free(output); } |