]> granicus.if.org Git - libass/commitdiff
Make sure the synth tmp buffer is large enough for be_blur
authorOleg Oshmyan <chortos@inbox.lv>
Mon, 9 Feb 2015 22:37:41 +0000 (00:37 +0200)
committerOleg Oshmyan <chortos@inbox.lv>
Tue, 10 Feb 2015 02:42:59 +0000 (04:42 +0200)
libass/ass_bitmap.c

index 609404f0318a5f985120761336f62ca8a8095ccf..d1ba819e5c8e0e315059f414e1dcdadf1786383e 100644 (file)
@@ -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;