From 872015813c6e181900faab5d1e53bb636bf8757f Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Fri, 29 Oct 2021 20:45:10 +0200 Subject: sub: assert potential pitfall This one got me debugging for quite a while. Assert it for the future. --- sub/osd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sub/osd.c b/sub/osd.c index f02693e921..b06fd242a3 100644 --- a/sub/osd.c +++ b/sub/osd.c @@ -506,8 +506,10 @@ void osd_rescale_bitmaps(struct sub_bitmaps *imgs, int frame_w, int frame_h, int vidh = res.h - res.mt - res.mb; double xscale = (double)vidw / frame_w; double yscale = (double)vidh / frame_h; - if (compensate_par < 0) + if (compensate_par < 0) { + assert(res.display_par); compensate_par = xscale / yscale / res.display_par; + } if (compensate_par > 0) xscale /= compensate_par; int cx = vidw / 2 - (int)(frame_w * xscale) / 2; -- cgit v1.2.3