NativeInstruments / ni-media

NI Media is a C++ library for reading and writing audio streams.
MIT License
244 stars 34 forks source link

Parsing large wav files may end up in infinite loop #64

Closed wro-ableton closed 1 year ago

wro-ableton commented 1 year ago

See https://github.com/NativeInstruments/ni-media/pull/63.

We've noticed that the bitmask 0xfffffe used to pad chunks while reading wave files could cause the seek position to be corrupted when seeking to positions larger than the bitmask. In the worst case, as encountered by us, this may end up in an infinite loop as the parser would start interpreting random parts of the file as chunk id and size and would move randomly through the file, possibly never leaving the loop.

We think this is a rather critical issue.

ni-mheppner commented 1 year ago

Fixed with PR #65.