From 5c60a78f2ebdca81f590707f48cf07420292044b Mon Sep 17 00:00:00 2001 From: Oleg Oshmyan Date: Tue, 10 Feb 2015 00:37:41 +0200 Subject: Make sure the synth tmp buffer is large enough for be_blur --- libass/ass_bitmap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libass/ass_bitmap.c b/libass/ass_bitmap.c index 609404f..d1ba819 100644 --- a/libass/ass_bitmap.c +++ b/libass/ass_bitmap.c @@ -126,7 +126,8 @@ static bool resize_tmp(ASS_SynthPriv *priv, int w, int h) { if (w >= INT_MAX || (w + 1) > SIZE_MAX / 2 / sizeof(unsigned) / FFMAX(h, 1)) return false; - size_t needed = sizeof(unsigned) * (w + 1) * h; + size_t needed = FFMAX(sizeof(unsigned) * (w + 1) * h, + sizeof(uint16_t) * ass_align(32, w) * 2); if (priv->tmp && priv->tmp_allocated >= needed) return true; -- cgit v1.2.3