Skip to content
This repository has been archived by the owner on Dec 8, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant