• Andreas Rheinhardt's avatar
    avformat/hlsenc: Improve checks for invalid stream mappings · c801ab43
    Andreas Rheinhardt authored
    The mapping of streams to the various variant streams to be created by
    the HLS muxer is roughly as follows: Space and tab separate variant
    stream group maps while the entries in each variant stream group map are
    separated by ','.
    
    The parsing process of each variant stream group proceeded as follows:
    At first the number of occurences of "a:", "v:" and "s:" in each variant
    stream group is calculated so that one can can allocate an array of
    streams with this number of entries. Then each entry is checked and the
    check for stream numbers was deficient: It did check that there is a
    number beginning after the ":", but it did not check that the number
    extends until the next "," (or until the end).
    
    This means that an invalid variant stream group like v:0_v:1 will not be
    rejected; the problem is that the variant stream in this example is
    supposed to have two streams associated with it (because it contains two
    "v:"), yet only one stream is actually associated with it (because there
    is no ',' to start a second stream specifier). This discrepancy led to
    segfaults (null pointer dereferencing) in the rest of the code (when the
    nonexistent second stream associated to the variant stream was inspected).
    
    Furthermore, this commit also removes an instance of using atoi() whose
    behaviour on a range error is undefined.
    
    Fixes ticket #8652.
    Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
    c801ab43
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...