From: wm4 Date: Sun, 16 Nov 2014 16:30:02 +0000 (+0100) Subject: Deal with code-duplication bullshit X-Git-Tag: 0.12.1~23 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4349eaea54f96b058a2014bb77a5acdf66195965;p=libass Deal with code-duplication bullshit Much of outline_to_bitmap() is duplicated. What? Add the overflow check to duplicated code too. --- diff --git a/libass/ass_bitmap.c b/libass/ass_bitmap.c index 97e93a0..658e2c7 100644 --- a/libass/ass_bitmap.c +++ b/libass/ass_bitmap.c @@ -367,7 +367,7 @@ Bitmap *outline_to_bitmap(ASS_Renderer *render_priv, bbox.xMin >>= 6; bbox.yMax >>= 6; - if (w * h > 8000000) { + if (w < 0 || h < 0 || w > 8000000 / FFMAX(h, 1)) { ass_msg(render_priv->library, MSGL_WARN, "Glyph bounding box too large: %dx%dpx", w, h); return NULL;