From fba9a75d8a0990de0c9bc1173bca580a38518b62 Mon Sep 17 00:00:00 2001 From: Ingo Oppermann Date: Wed, 25 Jun 2025 15:20:58 +0200 Subject: [PATCH] Add check for array length --- restream/core.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/restream/core.go b/restream/core.go index f954739f..270b66c8 100644 --- a/restream/core.go +++ b/restream/core.go @@ -324,7 +324,7 @@ func (r *restream) resourceObserver(ctx context.Context, rsc resources.Resources defer t.Release(token) limitGPU := false gpuindex := t.GetHWDevice() - if gpuindex >= 0 { + if gpuindex >= 0 && len(limitGPUs) >= gpuindex+1 { limitGPU = limitGPUs[gpuindex] } if t.Limit(limitCPU, limitMemory, limitGPU) {