mirror of
https://github.com/aler9/gortsplib
synced 2025-10-15 19:50:45 +08:00
formatdecenc: fix crash in MJPEG decoder; add fuzz tests
This commit is contained in:
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user