Skip to content

Commit 8f653cd

Browse files
committed
explicitly catch decode errors and report the failure
1 parent eb21029 commit 8f653cd

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

html5/js/VideoDecoder.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,13 @@ class XpraVideoDecoder {
188188
timestamp: options["frame"],
189189
};
190190
const chunk = new EncodedVideoChunk(init);
191-
this.videoDecoder.decode(chunk);
191+
try {
192+
this.videoDecoder.decode(chunk);
193+
} catch (error) {
194+
reject(
195+
new Error("failed to decode chunk: " + error)
196+
);
197+
}
192198

193199
let frame_out = this.decoded_frames.filter(
194200
(p) => p[8] === packet_sequence

0 commit comments

Comments
 (0)