mirror of
https://github.com/livekit/livekit.git
synced 2026-10-22 12:52:29 +00:00
Fix out-of-range access. (#2082)
Happens when converting quality in subscibed settings to layer. Looks like it can happen only if the provided quality is OFF. Don't know of any client that does that. Anyhow, prevent out-of-range access which causea a panic.
This commit is contained in:
1 parent
0b0431b765
commit
ca2f8fedab
1 file changed
+1
-1
+1
-1
@@ -539,7 +539,7 @@ func (w *WebRTCReceiver) getBufferLocked(layer int32) *buffer.Buffer {
|
||||
layer = 0
|
||||
}
|
||||
|
||||
if int(layer) >= len(w.buffers) {
|
||||
if layer < 0 || int(layer) >= len(w.buffers) {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user