cat / goq
clone

turns a linux box into a private steam streaming appliance: plug in, tap your key, play from another computer

fix: hvcC buffer overflow + inline unregister confirmation

dami etoile committed e662dfb
hvcC description buffer was 12 bytes too small — each NAL array entry
needs 5 bytes of overhead (type + count + length), not 1. Caused
RangeError when writing VPS/SPS/PPS entries.

Unregister now shows inline yes/no buttons instead of native confirm()
dialog — prevents accidental unregister when clicking near disconnect.
commit
e662dfb91d35fbc56126d34b43cedb49e8b2797b
parent
17bc2728c55b8ed47c56ba25e5c30c9df61bb048
author
dami etoile <dami.etoile@gmail.com>
1 file changed, +22 -4
Msrc/ui/index.html26++++++++++++++++++++++----
M src/ui/index.html +22 -4
@@ -486,13 +486,15 @@
486486 </div>487487 </div>488488 489- <!-- Bottom bar -->489+ <!-- Bottom bar -->490490 <div class="bottombar">491491 <span class="action primary" id="action-main" onclick="mainAction()">host</span>492492 <span class="sep hidden" id="sep-disconnect-main">·</span>493493 <span class="action danger hidden" id="action-disconnect" onclick="disconnect()">disconnect</span>494494 <span class="sep hidden" id="sep-disconnect">·</span>495495 <span class="action" id="action-unreg" onclick="unregister()">unregister</span>496+ <span class="action danger hidden" id="action-unreg-confirm" onclick="unregisterConfirm()">yes</span>497+ <span class="action hidden" id="action-unreg-cancel" onclick="unregisterCancel()">no</span>496498 <div class="spacer"></div>497499 <span class="pin-label" id="pin-label">pin</span>498500 <input class="pin-input" id="pin-input" type="password" placeholder="····" autocomplete="off" />
@@ -855,8 +857,22 @@
855857 }856858 857859 // ─── Unregister ─────────────────────────────────────────────────────858- async function unregister() {859- if (!confirm('Remove identity from keyring?')) return;860+ function unregister() {861+ // Show inline yes/no instead of confirm dialog862+ document.getElementById('action-unreg').style.display = 'none';863+ document.getElementById('action-unreg-confirm').classList.remove('hidden');864+ document.getElementById('action-unreg-cancel').classList.remove('hidden');865+ }866+867+ function unregisterCancel() {868+ document.getElementById('action-unreg-confirm').classList.add('hidden');869+ document.getElementById('action-unreg-cancel').classList.add('hidden');870+ document.getElementById('action-unreg').style.display = '';871+ }872+873+ async function unregisterConfirm() {874+ document.getElementById('action-unreg-confirm').classList.add('hidden');875+ document.getElementById('action-unreg-cancel').classList.add('hidden');860876 try {861877 await invoke('host_unregister');862878 registered = false;
@@ -869,6 +885,7 @@
869885 showIntro();870886 } catch (e) {871887 alert('unregister failed: ' + e);888+ document.getElementById('action-unreg').style.display = '';872889 }873890 }874891
@@ -1084,7 +1101,8 @@
10841101 10851102 function buildHvcDescription(vps, sps, pps) {10861103 // hvcC record format (ISO 14496-15 8.3.3.1.2)1087- const buf = new Uint8Array(23 + 3 + vps.length + sps.length + pps.length);1104+ // Header: 23 bytes. Per array: 1 (type) + 2 (count) + 2 (length) + nal data = 5 + nal1105+ const buf = new Uint8Array(23 + 15 + vps.length + sps.length + pps.length);10881106 let off = 0;10891107 buf[off++] = 1; // configurationVersion10901108 // profile space(2) + tier(1) + profile_idc(5)