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

Report error for non-quoted attribute strings #28

Open
gregfr opened this issue Sep 12, 2017 · 2 comments
Open

Report error for non-quoted attribute strings #28

gregfr opened this issue Sep 12, 2017 · 2 comments

Comments

@gregfr
Copy link

gregfr commented Sep 12, 2017

Greetings
I'm using VideoJS with HLS and I'm receiving exceptions for this line:

attr = (/([^=]*)=(.*)/).exec(attrs[i]).slice(1);

(parse-stream.js line 40)

The problem is, the attribute array is like this:

1:"PROGRAM-ID=1"
2:""
3:"BANDWIDTH=650000"
4:""
5:"RESOLUTION=600x356"
6:""
7:"CODECS=avc1.66.31"
8:",mp4a.40.2"

probably because it's parsed from a m3u8 manifest.

On the first line parsed, line 8, the regex returns undefined so there is no slice() method.

I'm not sure if parseAttributes() should be receiving this, but it definitely should check the regex result before using it.

@gregfr
Copy link
Author

gregfr commented Sep 12, 2017

BTW the error is initially due to a bad manifest (lack of quote) but many sources online use it.

@forbesjo
Copy link
Contributor

The spec (https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#page-29) indicates that CODECS are defined as a quoted string. In the future we will add validation warnings and errors to indicate that a manifest is not to spec, at the moment we don't have plans to handle bad manifests.

Keeping this open until we've implemented the validation warning

@forbesjo forbesjo changed the title Parser insufficient error checking on m3u8 manifest Report error for non-quoted attribute strings Sep 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants