Skip to content

Commit

Permalink
fix: Fix crash while playing HLS AES 128 streams (#5830)
Browse files Browse the repository at this point in the history
Fixes #5824
  • Loading branch information
avelad authored Oct 30, 2023
1 parent 29a611c commit 64b12c1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/media/streaming_engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -2219,7 +2219,11 @@ shaka.media.StreamingEngine = class {
mediaState.operation = null;
let result = response.data;
if (reference.aes128Key) {
const iter = mediaState.segmentIterator;
let iter = mediaState.segmentIterator;
const time = reference.startTime;
if (!iter && time != null) {
iter = mediaState.stream.segmentIndex.getIteratorForTime(time);
}
goog.asserts.assert(iter, 'mediaState.segmentIterator should exist');
result = await this.aes128Decrypt_(result, reference.aes128Key, iter);
}
Expand Down

0 comments on commit 64b12c1

Please sign in to comment.