diff options
Diffstat (limited to 'libvpx/vpx_scale/generic')
-rw-r--r-- | libvpx/vpx_scale/generic/yv12config.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libvpx/vpx_scale/generic/yv12config.c b/libvpx/vpx_scale/generic/yv12config.c index a89e29d..7c3f7ec 100644 --- a/libvpx/vpx_scale/generic/yv12config.c +++ b/libvpx/vpx_scale/generic/yv12config.c @@ -148,7 +148,10 @@ int vp9_realloc_frame_buffer(YV12_BUFFER_CONFIG *ybf, #else const int frame_size = yplane_size + 2 * uvplane_size; #endif - if (!ybf->buffer_alloc) { + if (frame_size > ybf->buffer_alloc_sz) { + // Allocation to hold larger frame, or first allocation. + if (ybf->buffer_alloc) + vpx_free(ybf->buffer_alloc); ybf->buffer_alloc = vpx_memalign(32, frame_size); ybf->buffer_alloc_sz = frame_size; } |