File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 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 {
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 ) ;
You can’t perform that action at this time.
0 commit comments