mirror of
https://github.com/aler9/gortsplib
synced 2025-10-28 09:31:33 +08:00
prevent decoding formats with zero clock rate or channels (#770)
This commit is contained in:
@@ -65,10 +65,9 @@ func (f *Opus) unmarshal(ctx *unmarshalContext) error {
|
||||
}
|
||||
|
||||
channelCount, err := strconv.ParseUint(tmp[1], 10, 31)
|
||||
if err != nil {
|
||||
if err != nil || channelCount == 0 {
|
||||
return fmt.Errorf("invalid channel count: '%s'", tmp[1])
|
||||
}
|
||||
|
||||
f.ChannelCount = int(channelCount)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user