abema / go-mp4

Go library for reading and writing MP4 file
https://dev.to/sunfishshogi/go-mp4-golang-library-and-cli-tool-for-mp4-52o1
MIT License
466 stars 30 forks source link

Prevent infinite loop when calling ReadBoxStructure #151

Closed aler9 closed 1 year ago

aler9 commented 1 year ago

@sunfish-shogi

When ReadBoxStructure is called against a box with a size of zero, an infinite loop is generated due to the fact that the loop contained in readBoxStructure() never ends. This patch fixes the issue and provides a test case.