]> granicus.if.org Git - libass/commitdiff
Deal with code-duplication bullshit
authorwm4 <wm4@nowhere>
Sun, 16 Nov 2014 16:30:02 +0000 (17:30 +0100)
committerwm4 <wm4@nowhere>
Sun, 16 Nov 2014 16:30:21 +0000 (17:30 +0100)
Much of outline_to_bitmap() is duplicated. What?

Add the overflow check to duplicated code too.

libass/ass_bitmap.c

index 97e93a0c6bc6e77115f07327cc1a6e0132bd8c08..658e2c7c023463c871da20ff6b9de7cc78a857ef 100644 (file)
@@ -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;