From 56ec3ea9f64e2434983f1aadf0241cc6cd09dc83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Tue, 8 Aug 2023 16:54:36 +0200 Subject: [PATCH] aspect: don't allow scaled_src_size be 0 It doesn't make sense to have zero here and it breaks, logic below. Width was still campled to 1, but with broken offset. This fixes things like video-scale-x=0 --- video/out/aspect.c | 1 + 1 file changed, 1 insertion(+) diff --git a/video/out/aspect.c b/video/out/aspect.c index c07fdce84a..b3e91fd73c 100644 --- a/video/out/aspect.c +++ b/video/out/aspect.c @@ -83,6 +83,7 @@ static void src_dst_split_scaling(int src_size, int dst_size, int *osd_margin_a, int *osd_margin_b) { scaled_src_size *= powf(2, zoom) * scale; + scaled_src_size = MPMAX(scaled_src_size, 1); align = (align + 1) / 2; *src_start = 0;