demux_mkv: store streams sequentially in demuxer->[avs]_streams
commitfc39d484653e40f9b79d33a595cfd550d61a6a34
authorUoti Urpala <uau@glyph.nonexistent.invalid>
Sat, 22 May 2010 07:14:41 +0000 (22 10:14 +0300)
committerUoti Urpala <uau@glyph.nonexistent.invalid>
Sat, 22 May 2010 07:26:45 +0000 (22 10:26 +0300)
treef51913ac02e459d833eb2e3d6932da66d0c56241
parent90bedd0b872b6eea02351aafb62e30ffec5c2152
demux_mkv: store streams sequentially in demuxer->[avs]_streams

demux_mkv used the Matroska TrackNumber as the array offset in demuxer
stream lists. The TrackNumber entry stored in the file can be an
arbitrary 64-bit value, and some of the code could try reading from
the arrays with that offset, causing a crash if the file had insane
values. Fill the arrays sequentially instead. Also add some checks to
make the handling of too high stream counts more robust.
libmpdemux/demux_mkv.c