• Andreas Rheinhardt's avatar
    avformat/matroskaenc: Fix edge case of writing Cues at the beginning · b7883434
    Andreas Rheinhardt authored
    The Matroska muxer has the ability to write the Cues (the index) at the
    beginning of the file (in front of the Cluster): The user inputs the
    amount of space that should be reserved at the beginning of the file and
    if this is sufficient, the Cues will be written there and the part of the
    reserved space not used up by the Cues will be filled with a "Void"
    element.
    
    There is just one problem with this: One can not fill a single byte this
    way, because said Void element is minimally two bytes long (one byte ID,
    one byte length field). Up until now, if one reserved one byte more than
    needed, one would run into an assert when writing the Void element.
    
    There are two solutions for this: Error out if it happens. Or adjust the
    length field of the Cues in order to ensure that the above situation
    can't happen (i.e. write the length on one byte more than necessary).
    The first solution is very unsatisfactory, as enough space has been
    reserved. Therefore this commit implements the second solution.
    Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
    b7883434
Name
Last commit
Last update
compat Loading commit data...
doc Loading commit data...
ffbuild Loading commit data...
fftools Loading commit data...
libavcodec Loading commit data...
libavdevice Loading commit data...
libavfilter Loading commit data...
libavformat Loading commit data...
libavresample Loading commit data...
libavutil Loading commit data...
libpostproc Loading commit data...
libswresample Loading commit data...
libswscale Loading commit data...
presets Loading commit data...
tests Loading commit data...
tools Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
CONTRIBUTING.md Loading commit data...
COPYING.GPLv2 Loading commit data...
COPYING.GPLv3 Loading commit data...
COPYING.LGPLv2.1 Loading commit data...
COPYING.LGPLv3 Loading commit data...
CREDITS Loading commit data...
Changelog Loading commit data...
INSTALL.md Loading commit data...
LICENSE.md Loading commit data...
MAINTAINERS Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
RELEASE Loading commit data...
configure Loading commit data...