瀏覽代碼

fixed error where 9-bit status chunk was being produced and added maximum length check

dds
Matt Bradshaw 6 年之前
父節點
當前提交
f90eb6b81c
共有 1 個檔案被更改,包括 3 行新增2 行删除
  1. +3
    -2
      extras/wav2sketch/wav2sketch.js

+ 3
- 2
extras/wav2sketch/wav2sketch.js 查看文件

@@ -45,8 +45,9 @@ function processFile(file, fileName) {
var padLength = padding(outputData.length, 128);

var statusInt = (outputData.length*2).toString(16);
while(statusInt.length < 4) statusInt = '0' + statusInt;
statusInt = '0x8100' + statusInt;
while(statusInt.length < 6) statusInt = '0' + statusInt;
if(outputData.length*2>0xFFFFFF) alert("DATA TOO LONG");
statusInt = '0x81' + statusInt;
outputData.unshift(statusInt);

for(var i=0;i<padLength;i++) {

Loading…
取消
儲存