]> granicus.if.org Git - handbrake/commitdiff
Fix arithmetic exception in hb_set_anamorphic_size2() when displaying preview
authorEmeric <emeric.grange@gmail.com>
Wed, 8 Aug 2018 10:50:25 +0000 (12:50 +0200)
committerBradley Sepos <bradley@bradleysepos.com>
Thu, 9 Aug 2018 02:30:39 +0000 (22:30 -0400)
(cherry picked from commit db44173e3b6dec5a4407ac13fd6d0efd6bc4f625)

libhb/hb.c

index b973645b009497229c35f5b246bf0c177a9b7879..0788169d618338c4a692d9a319eae3e3843492e9 100644 (file)
@@ -803,7 +803,7 @@ void hb_set_anamorphic_size2(hb_geometry_t *src_geo,
     int cropped_width = src_geo->width - geo->crop[2] - geo->crop[3];
     int cropped_height = src_geo->height - geo->crop[0] - geo->crop[1];
     double storage_aspect = (double)cropped_width / cropped_height;
-    int mod = geo->modulus ? EVEN(geo->modulus) : 2;
+    int mod = (geo->modulus > 0) ? EVEN(geo->modulus) : 2;
 
     // Sanitize PAR
     if (geo->geometry.par.num == 0 || geo->geometry.par.den == 0)