We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fa207d7 commit 4160a9fCopy full SHA for 4160a9f
rfc8888.go
@@ -7,6 +7,7 @@ import (
7
"encoding/binary"
8
"errors"
9
"fmt"
10
+ "math"
11
)
12
13
// https://www.rfc-editor.org/rfc/rfc8888.html#name-rtcp-congestion-control-fee
@@ -256,10 +257,15 @@ func (b *CCFeedbackReportBlock) unmarshal(rawPacket []byte) error {
256
257
if numReportsField == 0 {
258
return nil
259
}
260
+
261
+ if int(b.BeginSequence)+int(numReportsField) > math.MaxUint16 {
262
+ return errIncorrectNumReports
263
+ }
264
265
endSequence := b.BeginSequence + numReportsField
266
numReports := endSequence - b.BeginSequence + 1
267
- if len(rawPacket) < int(reportsOffset+numReports*2) {
268
+ if len(rawPacket) < reportsOffset+int(numReports)*2 {
269
return errIncorrectNumReports
270
271
b.MetricBlocks = make([]CCFeedbackMetricBlock, numReports)
0 commit comments