PSSH: Fix get_as_box parsing on arbitrary init data

An IOError can occur if the mp4 box parsing fails because it could not read enough bytes.
This commit is contained in:
rlaphoenix 2022-08-02 01:26:31 +01:00
parent 6a286a4c23
commit 97126391c4
1 changed files with 1 additions and 1 deletions

View File

@ -112,7 +112,7 @@ class PSSH:
if isinstance(data, bytes): if isinstance(data, bytes):
try: try:
data = Box.parse(data) data = Box.parse(data)
except construct.ConstructError: except (IOError, construct.ConstructError):
if strict: if strict:
try: try:
cenc_header = WidevinePsshData() cenc_header = WidevinePsshData()