formatdecenc: fix crash in MJPEG decoder; add fuzz tests

This commit is contained in:
aler9
2023-01-07 16:43:45 +01:00
parent 441a90a519
commit 0499d99e83
46 changed files with 232 additions and 582 deletions

View File

@@ -167,6 +167,10 @@ func (d *Decoder) Decode(pkt *rtp.Packet) ([]byte, time.Duration, error) {
return nil, 0, ErrMorePacketsNeeded
}
if d.fragmentedSize < 2 {
return nil, 0, fmt.Errorf("invalid data")
}
data := make([]byte, d.fragmentedSize)
pos := 0