sub: assert potential pitfall

This one got me debugging for quite a while. Assert it for the future.
This commit is contained in:
Niklas Haas 2021-10-29 20:45:10 +02:00 committed by Niklas Haas
parent c704824b45
commit 872015813c
1 changed files with 3 additions and 1 deletions

View File

@ -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;