diff options
Diffstat (limited to 'libass/ass_bitmap.c')
-rw-r--r-- | libass/ass_bitmap.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libass/ass_bitmap.c b/libass/ass_bitmap.c index 2955b9f..aadce59 100644 --- a/libass/ass_bitmap.c +++ b/libass/ass_bitmap.c @@ -124,9 +124,9 @@ static bool generate_tables(ASS_SynthPriv *priv, double radius) static bool resize_tmp(ASS_SynthPriv *priv, int w, int h) { - if (w > SIZE_MAX / sizeof(unsigned) / h) + if ((w - 1) > SIZE_MAX / sizeof(unsigned) / h) return false; - size_t needed = sizeof(unsigned) * w * h; + size_t needed = sizeof(unsigned) * (w + 1) * h; if (priv->tmp && priv->tmp_allocated >= needed) return true; if (needed >= SIZE_MAX / 2) |