Skip to content

Commit

Permalink
#92 validate the pixel data
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Aug 19, 2021
1 parent 3f7c084 commit f1d2cf9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions html5/js/DecodeWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,10 @@ function decode_draw_packet(packet) {
}
else if (coding=="png" || coding=="jpeg" || coding=="webp") {
const data = packet[7];
if (!data.buffer) {
decode_error("missing pixel data buffer: "+(typeof data));
return;
}
const blob = new Blob([data.buffer]);
hold();
createImageBitmap(blob, {
Expand Down

0 comments on commit f1d2cf9

Please sign in to comment.