From c0c32b270e1963e47dd38e102cc9baaf36f585aa Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Fri, 16 Feb 2024 10:02:13 -0600 Subject: [PATCH] vo_gpu_next: don't add 0 width/height sub bitmaps to pl_overlay Previously, libplacebo would fail to render the image since mpv was feeding it bogus bitmaps with 0 width/height. An easy way to encounter this would be to set sub-scale to 0 with bitmap/image subs. --- video/out/vo_gpu_next.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c index a4274a65eb..31b4200779 100644 --- a/video/out/vo_gpu_next.c +++ b/video/out/vo_gpu_next.c @@ -294,6 +294,8 @@ static void update_overlays(struct vo *vo, struct mp_osd_res res, entry->num_parts = 0; for (int i = 0; i < item->num_parts; i++) { const struct sub_bitmap *b = &item->parts[i]; + if (b->dw == 0 || b->dh == 0) + continue; uint32_t c = b->libass.color; struct pl_overlay_part part = { .src = { b->src_x, b->src_y, b->src_x + b->w, b->src_y + b->h },