From 50b38cf1aa753f0c406b249d8e78a0689572d69b Mon Sep 17 00:00:00 2001 From: Wan-Teh Chang Date: Mon, 14 Jan 2019 11:54:59 -0800 Subject: [PATCH] Reset buffer_alloc_sz after freeing buffer_alloc. ybf->buffer_alloc and ybf->buffer_alloc_sz should ideally be kept in sync. If ybf->buffer_alloc is reset to NULL after being freed, then ybf->buffer_alloc_sz should be reset to 0. Change-Id: I7e7566b563ddf145d0e46050c5b6bd141084f8b3 --- vpx_scale/generic/yv12config.c | 1 + 1 file changed, 1 insertion(+) diff --git a/vpx_scale/generic/yv12config.c b/vpx_scale/generic/yv12config.c index 08679a472..eee291c30 100644 --- a/vpx_scale/generic/yv12config.c +++ b/vpx_scale/generic/yv12config.c @@ -228,6 +228,7 @@ int vpx_realloc_frame_buffer(YV12_BUFFER_CONFIG *ybf, int width, int height, // Allocation to hold larger frame, or first allocation. vpx_free(ybf->buffer_alloc); ybf->buffer_alloc = NULL; + ybf->buffer_alloc_sz = 0; ybf->buffer_alloc = (uint8_t *)vpx_memalign(32, (size_t)frame_size); if (!ybf->buffer_alloc) return -1; -- 2.50.1