Skip to content

Commit 2cd92a8

Browse files
authored
Merge pull request #1865 from canalplus/patch-empty-encrypted-event
fix(drm): ignore empty encryption data
2 parents 50250cc + dfd5581 commit 2cd92a8

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎src/compat/eme/get_init_data.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,11 @@ export default function getInitData(
155155
return null;
156156
}
157157

158+
if (initData.byteLength === 0) {
159+
log.warn("DRM", "Init data is empty on media encrypted event.");
160+
return null;
161+
}
162+
158163
const initDataBytes = new Uint8Array(initData);
159164
const values = getInitializationDataValues(initDataBytes);
160165
return { type: initDataType, values, forceSessionRecreation };

0 commit comments

Comments
 (0)