Commit Graph

1 Commits

Author SHA1 Message Date
Moritz Bunkus
21eb1ecd5b mkvmerge: don't try to relocate written data when discarding
relocate_written_data is called in the following situation:

* track headers need to be re-written
* at least one frame has been written already
* the space left right after the track headers does not suffice to
  expand the track headers

In such a case all frames that have been written already will be
moved.

However, in certain split modes then current file may actually be a
null I/O, meaning that the current output is discarded. A null I/O
object doesn't return anything when reading for it, causing an endless
loop in the relocation code which calls `read` as often as needed
until everything's been read — which can never happen with a null I/O
object.

However, it makes no sense to try to actually read the data in such a
case, as it will be discarded anyway. Therefore just avoid trying to
read the data in the first place.

Fixes #1944.
2017-04-16 07:35:25 +02:00