From 636bd7885410539595ef45c7e8dc36461ad04686 Mon Sep 17 00:00:00 2001 From: gx Date: Thu, 21 May 2026 07:08:23 +0100 Subject: [PATCH] =?UTF-8?q?vf=5Fcuda=5Fgrid:=20overlay=20=D1=81=20invalid?= =?UTF-8?q?=20cell=20=E2=80=94=20silent=20skip=20=D0=B2=D0=BC=D0=B5=D1=81?= =?UTF-8?q?=D1=82=D0=BE=20AVERROR?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Когда controller broadcast'ит overlay command ко всем cuda_grid instances (quad/single/mpp), overlay с cell=2 (gate_lpr cell в quad/mpp) попадает в single layout который имеет nb_cells=1 → overlay_pixel_rect возвращал AVERROR(EINVAL) → render_overlays propagated к cuda_grid_compose → "Error while filtering: Invalid argument" каждый frame → pipeline crash loop. Fix: return 1 (positive skip) вместо AVERROR. render_overlay_rect уже имеет `if (ret != 0) return ret < 0 ? ret : 0;` — positive skip правильно обрабатывается без error. Co-Authored-By: Claude Opus 4.7 --- libavfilter/vf_cuda_grid.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavfilter/vf_cuda_grid.c b/libavfilter/vf_cuda_grid.c index 3bb2852..6367239 100644 --- a/libavfilter/vf_cuda_grid.c +++ b/libavfilter/vf_cuda_grid.c @@ -476,7 +476,10 @@ static int overlay_pixel_rect(CudaGridContext *s, const GridOverlay *ov, base_w = s->cell_px[ov->cell].w; base_h = s->cell_px[ov->cell].h; } else { - return AVERROR(EINVAL); + /* Cell index out of range — silently skip (overlay broadcast'нет ко всем + * cuda_grid instances, layouts с меньшим nb_cells). NOT error чтобы + * не валить filter chain. */ + return 1; } rx = base_x + (int)(ov->x * base_w);