]> granicus.if.org Git - libvpx/commitdiff
Reset buffer_alloc_sz after freeing buffer_alloc.
authorWan-Teh Chang <wtc@google.com>
Mon, 14 Jan 2019 19:54:59 +0000 (11:54 -0800)
committerWan-Teh Chang <wtc@google.com>
Mon, 14 Jan 2019 19:54:59 +0000 (11:54 -0800)
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

index 08679a47218507bc9d5fb255396702b9d5dd4d20..eee291c30d8bcf01bc11b36e09544c66dee9e7ec 100644 (file)
@@ -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;