From 97126391c42127931498dbc03373c7c0a673fbd7 Mon Sep 17 00:00:00 2001 From: rlaphoenix Date: Tue, 2 Aug 2022 01:26:31 +0100 Subject: [PATCH] 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. --- pywidevine/pssh.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pywidevine/pssh.py b/pywidevine/pssh.py index 04bcfa7..c36b47f 100644 --- a/pywidevine/pssh.py +++ b/pywidevine/pssh.py @@ -112,7 +112,7 @@ class PSSH: if isinstance(data, bytes): try: data = Box.parse(data) - except construct.ConstructError: + except (IOError, construct.ConstructError): if strict: try: cenc_header = WidevinePsshData()