Skip to content

Commit 61edba0

Browse files
committed
Bug fixes
1 parent 6d9e532 commit 61edba0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

make.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1055,6 +1055,11 @@
10551055
const allFields = [...SPEC.core.fields, ...SPEC.extended.fields];
10561056
for (const f of allFields) {
10571057
const addr = parseHex(f.start);
1058+
1059+
if (addr > data.length) {
1060+
break;
1061+
}
1062+
10581063
const bytes = read(addr, f.length);
10591064

10601065
try {
@@ -1064,12 +1069,14 @@
10641069
} else if (f.type === "rgba") {
10651070
const [r = 0, g = 0, b = 0, a = 255] = bytes;
10661071
const color = document.getElementById(f.id + "_rgb");
1067-
if (color)
1072+
if (color) {
10681073
color.value =
10691074
"#" +
10701075
[r, g, b]
10711076
.map((x) => x.toString(16).toUpperCase().padStart(2, "0"))
10721077
.join("");
1078+
color.dispatchEvent(new Event("input", { bubbles: true }));
1079+
}
10731080
const alpha = document.getElementById(f.id + "_a");
10741081
if (alpha) alpha.value = a;
10751082
const out = document.getElementById(f.id);

0 commit comments

Comments
 (0)