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

MediaPlaylist decode custom tag panic #164

Open
panda1986 opened this issue May 25, 2020 · 0 comments
Open

MediaPlaylist decode custom tag panic #164

panda1986 opened this issue May 25, 2020 · 0 comments

Comments

@panda1986
Copy link

func (p *MediaPlaylist) decode(buf *bytes.Buffer, strict bool) error {
var eof bool
var line string
var err error

state := new(decodingState)
wv := new(WV)

for !eof {
	if line, err = buf.ReadString('\n'); err == io.EOF {
		eof = true
	} else if err != nil {
		break
	}

	err = decodeLineOfMediaPlaylist(p, wv, state, line, strict)
	if strict && err != nil {
		return err
	}

}
if state.tagWV {
	p.WV = wv
}
if strict && !state.m3u {
	return errors.New("#EXTM3U absent")
}
return nil

}


if p has customDecoder, directly decode, but state not initalized, when call decodeLineOfMediaPlaylist will panic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant