summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_encoder.c
diff options
context:
space:
mode:
authorJames Zern <jzern@google.com>2022-07-06 15:06:51 -0700
committerJames Zern <jzern@google.com>2022-07-06 15:10:39 -0700
commit933b6b90a583b593efd8acb644603ab189226309 (patch)
tree5be833b58fa7e4ead2dfdb533fec9117a14c8366 /vp9/encoder/vp9_encoder.c
parent7b65e46983e8aae8024fef562a68aa72d7a111b9 (diff)
downloadlibvpx-933b6b90a583b593efd8acb644603ab189226309.tar
libvpx-933b6b90a583b593efd8acb644603ab189226309.tar.gz
libvpx-933b6b90a583b593efd8acb644603ab189226309.tar.bz2
libvpx-933b6b90a583b593efd8acb644603ab189226309.zip
Revert "Fix bug with smaller width bigger size"
This reverts commit 5b530fc962bcb8a51bbf03f5fbc2912f21b86e70. This fixes memory related fuzzer failures in the decoder. Bug: webm:1642 Bug: oss-fuzz:48609 Bug: oss-fuzz:48629 Bug: oss-fuzz:48632 Bug: oss-fuzz:48638 Bug: oss-fuzz:48639 Bug: oss-fuzz:48651 Bug: oss-fuzz:48657 Bug: oss-fuzz:48659 Bug: oss-fuzz:48660 Bug: oss-fuzz:48661 Bug: oss-fuzz:48680 Bug: oss-fuzz:48686 Bug: oss-fuzz:48697 Bug: oss-fuzz:48706 Bug: oss-fuzz:48712 Bug: oss-fuzz:48717 Bug: oss-fuzz:48728 Bug: oss-fuzz:48732 Bug: oss-fuzz:48780 Bug: oss-fuzz:48781 Bug: oss-fuzz:48782 Bug: oss-fuzz:48785 Change-Id: I67a8539a3083f00eec1164fef5c6a8bc209f91fc
Diffstat (limited to 'vp9/encoder/vp9_encoder.c')
-rw-r--r--vp9/encoder/vp9_encoder.c27
1 files changed, 2 insertions, 25 deletions
diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c
index d58e8a312..371779e77 100644
--- a/vp9/encoder/vp9_encoder.c
+++ b/vp9/encoder/vp9_encoder.c
@@ -1972,17 +1972,6 @@ static void alloc_copy_partition_data(VP9_COMP *cpi) {
}
}
-static void free_copy_partition_data(VP9_COMP *cpi) {
- vpx_free(cpi->prev_partition);
- cpi->prev_partition = NULL;
- vpx_free(cpi->prev_segment_id);
- cpi->prev_segment_id = NULL;
- vpx_free(cpi->prev_variance_low);
- cpi->prev_variance_low = NULL;
- vpx_free(cpi->copied_frame_cnt);
- cpi->copied_frame_cnt = NULL;
-}
-
void vp9_change_config(struct VP9_COMP *cpi, const VP9EncoderConfig *oxcf) {
VP9_COMMON *const cm = &cpi->common;
RATE_CONTROL *const rc = &cpi->rc;
@@ -2062,8 +2051,6 @@ void vp9_change_config(struct VP9_COMP *cpi, const VP9EncoderConfig *oxcf) {
new_mi_size = cm->mi_stride * calc_mi_size(cm->mi_rows);
if (cm->mi_alloc_size < new_mi_size) {
vp9_free_context_buffers(cm);
- vp9_free_pc_tree(&cpi->td);
- vpx_free(cpi->mbmi_ext_base);
alloc_compressor_data(cpi);
realloc_segmentation_maps(cpi);
cpi->initial_width = cpi->initial_height = 0;
@@ -2082,18 +2069,8 @@ void vp9_change_config(struct VP9_COMP *cpi, const VP9EncoderConfig *oxcf) {
update_frame_size(cpi);
if (last_w != cpi->oxcf.width || last_h != cpi->oxcf.height) {
- vpx_free(cpi->consec_zero_mv);
- CHECK_MEM_ERROR(
- cm, cpi->consec_zero_mv,
- vpx_calloc(cm->mi_rows * cm->mi_cols, sizeof(*cpi->consec_zero_mv)));
-
- vpx_free(cpi->skin_map);
- CHECK_MEM_ERROR(
- cm, cpi->skin_map,
- vpx_calloc(cm->mi_rows * cm->mi_cols, sizeof(cpi->skin_map[0])));
-
- free_copy_partition_data(cpi);
- alloc_copy_partition_data(cpi);
+ memset(cpi->consec_zero_mv, 0,
+ cm->mi_rows * cm->mi_cols * sizeof(*cpi->consec_zero_mv));
if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ)
vp9_cyclic_refresh_reset_resize(cpi);
rc->rc_1_frame = 0;