summaryrefslogtreecommitdiffstats
path: root/sub
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.dev>2021-10-29 20:45:10 +0200
committerNiklas Haas <github-daiK1o@haasn.dev>2021-11-03 14:09:27 +0100
commit872015813c6e181900faab5d1e53bb636bf8757f (patch)
treec859973c3a623da669b4f8d6ca2b1dd26358289c /sub
parentc704824b45731f2400355ebe8ae0c576e19dc072 (diff)
downloadmpv-872015813c6e181900faab5d1e53bb636bf8757f.tar.bz2
mpv-872015813c6e181900faab5d1e53bb636bf8757f.tar.xz
sub: assert potential pitfall
This one got me debugging for quite a while. Assert it for the future.
Diffstat (limited to 'sub')
-rw-r--r--sub/osd.c4
1 files changed, 3 insertions, 1 deletions
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;