diff options
author | Niklas Haas <git@haasn.dev> | 2021-10-29 20:45:10 +0200 |
---|---|---|
committer | Niklas Haas <github-daiK1o@haasn.dev> | 2021-11-03 14:09:27 +0100 |
commit | 872015813c6e181900faab5d1e53bb636bf8757f (patch) | |
tree | c859973c3a623da669b4f8d6ca2b1dd26358289c /sub/osd.c | |
parent | c704824b45731f2400355ebe8ae0c576e19dc072 (diff) | |
download | mpv-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/osd.c')
-rw-r--r-- | sub/osd.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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; |