Opened 14 years ago
Last modified 13 years ago
#1751 new defect
[PATCH] hang in demux_mkv
Reported by: | Owned by: | reimar | |
---|---|---|---|
Priority: | normal | Component: | demuxer |
Version: | HEAD | Severity: | normal |
Keywords: | Cc: | compn, sh_fs_mplayer@… | |
Blocked By: | Blocking: | ||
Reproduced by developer: | no | Analyzed by developer: | no |
Description
According to the EBML specs, both signed and unsigned MKV data integers have a possible length from 0 to 8 bytes, inclusive. In particular, integers with a length of 0 bytes are valid both for signed and unsigned values, and are defined to have a value of 0 in both cases[1].
Current mplayer versions do not correctly deal with 0-byte integers in MKV files. When encountering such a value, mplayer will enter a busy loop, preventing further parsing of the MKV file in question and also wasting cputime until the process is terminated through external means. This problem will occur with both the 'lavf' and the 'mkv' mkv demuxer, since they use the same code for EBML integer value parsing.
What this comes down to is that there are valid MKV files that will be played back correctly by other software but will hang mplayer, even though parsing them correctly is not difficult.
I am attaching a small MKV file (without any actual data streams) that triggers the uint part of this bug in current mplayer SVN (i.e. rev 31906) for verification purposes.
The problem is caused by lack of support for 0-length values in ebml_read_uint() and ebml_read_int() in libmpdemux/ebml.c, and can be easily fixed for both cases. I'll follow up with a simple patch that does this.
[1] <http://www.matroska.org/technical/specs/rfc/index.html>, section 2.4.
Attachments (2)
Change History (8)
by , 14 years ago
Attachment: | 0byte_uint.mkv added |
---|
comment:2 by , 14 years ago
Cc: | added |
---|
comment:3 by , 14 years ago
Quick correction: The LAVF demuxer is actually not affected by this, and mplayer will play mkv files containing 0byte-ints fine if started using '-demuxer lavf' or with an equivalent config file option.
In absence of any such options (or with '-demuxer mkv') however, the current svn version of mplayer (r:32033) will hang when pointed at a problematic mkv file.
comment:4 by , 13 years ago
Cc: | added |
---|---|
Summary: | Matroska 0-byte INTs cause mplayer hangs on demux → hang in demux_mkv |
lavf mkv demuxer is now default so this probably wont be fixed any time soon.
comment:5 by , 13 years ago
Summary: | hang in demux_mkv → [PATCH] hang in demux_mkv |
---|
comment:6 by , 13 years ago
Owner: | changed from | to
---|
Demonstration matroska file