• Andreas Rheinhardt's avatar
    avformat/matroskadec: Improve invalid length error handling · 04b62bd7
    Andreas Rheinhardt authored
    1. Up until now, the error message for EBML numbers whose length exceeds
    the limits imposed upon them because of the element's type did not
    distinguish between known-length and unknown-length elements. As a
    consequence, the numerical value of the define constant
    EBML_UNKNOWN_LENGTH was emitted as part of the error message which is
    of course not appropriate. This commit changes this by adding error
    messages designed for unknown-length elements.
    
    2. We impose some (arbitrary) sanity checks on the lengths of certain
    element types; these checks were conducted before the checks depending
    on whether the element exceeds its containing master element. Now the
    order has been reversed, because a failure at the (formerly) latter
    check implies that the file is truly erroneous and not only fails our
    arbitrary length limit. Moreover, this increases the informativeness of
    the error messages.
    
    3. Furthermore, the error message in general has been changed by replacing
    the type of the element (something internal to this demuxer and
    therefore suitable as debug output at best, not as an error message
    intended for ordinary users) with the element ID. The element's position
    has been added, too.
    
    4. Finally, the length limit for EBML_NONE elements has been changed so
    that all unknown-length elements of EBML_NONE-type trigger an error.
    This is done because unknown-length elements can't be skipped and need
    to be parsed, but there is no syntax to parse available for EBML_NONE
    elements. This is done in preparation for a further patch which allows
    more unknown-length elements than just clusters and segments.
    Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
    04b62bd7
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...
.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...