summaryrefslogtreecommitdiff
path: root/vpx_scale
diff options
context:
space:
mode:
authorAdrian Grange <agrange@google.com>2013-11-14 14:55:49 -0800
committerAdrian Grange <agrange@google.com>2013-11-14 15:53:09 -0800
commit38144ed8b24138bd764f4201fe4d73438465c653 (patch)
tree1a97a783014b562c480fa562c54d3095a113db2a /vpx_scale
parente6b72d0119041c60fb3baab67f963638b4cc6ed6 (diff)
downloadlibvpx-38144ed8b24138bd764f4201fe4d73438465c653.tar.gz
libvpx-38144ed8b24138bd764f4201fe4d73438465c653.tar.bz2
libvpx-38144ed8b24138bd764f4201fe4d73438465c653.zip
fix scalling bug by buffer auto-reallocation
Change-Id: Ib748eb287520c794631697204da6ebe19523ce95
Diffstat (limited to 'vpx_scale')
-rw-r--r--vpx_scale/generic/yv12config.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/vpx_scale/generic/yv12config.c b/vpx_scale/generic/yv12config.c
index a89e29d86..7c3f7ece9 100644
--- a/vpx_scale/generic/yv12config.c
+++ b/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;
}