43081j / 43081j/id3

Index out of range [when parsing images]

未關閉
#10 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
TypeScript
星號
344
分支
66
PR 合併指標
30 天內沒有已合併 PR

描述

The parser freaks out on some embedded images, it seems completely random as to what images do and don't trip it:

```
Uncaught node.js Error

Error: Index out of range.
at Object.ID3Frame.parse (/home/damon/projects/tunes/node_modules/id3js/dist/id3.js:696:13)
at eval (/home/damon/projects/tunes/node_modules/id3js/dist/id3.js:943:24)
at eval (/home/damon/projects/tunes/node_modules/id3js/dist/id3.js:118:4)
at Object.wrapper [as oncomplete] (fs.js:454:17)
```

An example of one it's breaking on: http://pastebin.com/1RRDqknW

As you can see it kinda just cuts off part way through parsing the image.

If I delete the image from the ID3 tag, it parses that file fine and then breaks on a later one.

The only thing the breaking images seem to have had in common is that they're mostly fairly high res (both this and the previous one were 800x800) though there have been ones smaller such as 400x360 which have broken in the same way.

There should really be an option to skip parsing images so those getting this issue can just bypass the image parsing and so this module will still be usable.

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

錯誤發生在 id3.js 的 ID3Frame.parse 第 696 行,可能是在處理影像 frame (APIC) 時發生的。檢查 pastebin 連結中的範例影像資料,以了解格式錯誤的結構。查看原始碼中解析影像 frame 的邏輯,檢查緩衝區長度驗證,並考慮依照建議新增跳過影像解析的選項。使用提供的問題檔案進行測試,以重現索引超出範圍錯誤。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
javascript
領域
audio-video-rtc
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。