• Andreas Rheinhardt's avatar
    avformat/matroskaenc: Don't assert when writing huge files · 575557ce
    Andreas Rheinhardt authored
    EBML numbers are variable length numbers: Only seven bits of every byte
    are available to encode the number, the other bits encode the length of
    the number itself. So an eight byte EBML number can only encode numbers
    in the range 0..(2^56 - 1). And when using EBML numbers to encode the
    length of an EBML element, the EBML number corresponding to 2^56 - 1 is
    actually reserved to mean that the length of the corresponding element
    is unknown.
    
    And therefore put_ebml_length() asserted that the length it should
    represent is < 2^56 - 1. Yet there was nothing that actually guaranteed
    this to be true for the Segment (the main/root EBML element of a
    Matroska file that encompasses nearly the whole file). This commit
    changes this by checking in advance how big the length is and only
    updating the number if it is representable at all; if not, the unknown
    length element is not touched.
    Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
    575557ce
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...