untangledco / streaming

Media streaming and broadcast systems in Go
https://twitch.tv/untangledco
ISC License
82 stars 5 forks source link

m3u8: catch invalid CCInfo.ID values #6

Closed ollytom closed 3 months ago

ollytom commented 3 months ago

In parseCCInfo(), we can parse values for the ID field that are invalid. The only valid values for CCInfo.ID are the 4 integers 1, 2, 3, 4. For example, we parse this playlist without error:

#EXTM3U
#EXT-X-VERSION:7
#EXT-X-MEDIA:TYPE=AUDIO,INSTREAM-ID="CC69"

The only valid values for the INSTREAM-ID attribute are "CC1", "CC2", "CC3", "CC4" and "SERVICE1" through "SERVICE63".