From: Wan-Teh Chang Date: Mon, 14 Jan 2019 19:54:59 +0000 (-0800) Subject: Reset buffer_alloc_sz after freeing buffer_alloc. X-Git-Tag: v1.8.1~317^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=50b38cf1aa753f0c406b249d8e78a0689572d69b;p=libvpx 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 --- 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;