Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 when datalen is 0, parse failed #47

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
record data
JINLEI1 authored and JINLEI1 committed Jan 11, 2018
commit 357b78741c782232d388d3fd9a8de7e0408e21ba
8 changes: 8 additions & 0 deletions codec/h264parser/parser.go
Original file line number Diff line number Diff line change
@@ -701,6 +701,14 @@ func ParseSliceHeaderFromNALU(packet []byte) (sliceType SliceType, info common.T
info.RefIdc = (int(packet[0]&0x1f) >> 5)

info.UnitType = MAP_UNIT_TYPE[int(packet[0]&0x1f)]
info.NumBytes = len(packet)
info.Data = append(info.Data, packet...)

// if info.UnitType == "FILLER" {
// if len(packet) > 16 {
// spew.Dump(packet[0:15])
// }
// }

if len(packet) <= 1 {
err = fmt.Errorf("h264parser: packet too short to parse slice header")