hls.js
hls.js copied to clipboard
Bugfix: TypeError: Cannot read properties of null… payload.byteLength (timeline-controller)
This PR will...
Adds check that payload is not null
Why is this Pull Request needed?
Prevents errors:
Uncaught (in promise) TypeError: Cannot read properties of null (reading 'byteLength')
Uncaught (in promise) TypeError: payload is null
Are there any points in the code the reviewer needs to double check?
this.logEnabled = true;
const result = this.softwareDecrypt(data, key, iv);
if (result === null) {
+ this.reset();
Resolves issues:
#4898
Checklist
- [x] changes have been done against master branch, and PR does not conflict
- [ ] new unit / functional tests have been added (whenever applicable)
- [ ] API or design changes are documented in API.md
Hi @mtoczko,
Thanks for the fixes. I missed this one before cutting v1.2.3. However, I closed #4898 as I was not able to reproduce the payload exceptions using the stream or steps in the AES-128 VTT loop loading issue. Is this intermittent or are there additional steps needed to repro?
Thanks for the fixes. I missed this one before cutting v1.2.3. However, I closed #4898 as I was not able to reproduce the
payloadexceptions using the stream or steps in the AES-128 VTT loop loading issue. Is this intermittent or are there additional steps needed to repro?
@robwalch - I can still repro the payload exceptions. But by now I believe they were/are caused by hard reloads of the demo page. In 'normal' use I cannot repro (famous last words).
Hi @phloxic Do you have a longer test stream? (I mean more vtt segemnts)
@robwalch
There may also be some error with the key, because now it tries to download the fragment again if the payload was 'null'. And the error goes away after reloading the key.

Hi @phloxic Do you have a longer test stream? (I mean more vtt segemnts)
@mtoczko here you go: https://d12zt1n3pd4xhr.cloudfront.net/dev/aesx-s-cc-en.m3u8
@phloxic What AES mode are you using?
@phloxic What AES mode are you using?
Oh, in that version AES-128 for audio and subtitles, and Sample AES for the video. The original symptoms were the same when using AES-128 for everything. Do you need another one like that?
Hi @robwalch Your PR #4861 solves the problem with webCryptoDecrypt, there must have been some conflict/race. I removed the attempt to reload the fragment, only a warning will be returned.
@robwalch If you could resolve this conflict, that would be great.