From: Oleg Oshmyan Date: Mon, 9 Feb 2015 22:37:41 +0000 (+0200) Subject: Make sure the synth tmp buffer is large enough for be_blur X-Git-Tag: 0.12.3~4^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5c60a78f2ebdca81f590707f48cf07420292044b;p=libass Make sure the synth tmp buffer is large enough for be_blur --- 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;