• Andreas Rheinhardt's avatar
    h264_mp4toannexb: Improve extradata overread checks · 268dffc1
    Andreas Rheinhardt authored
    Currently during parsing the extradata, h264_mp4toannexb checks for
    overreads by adding the size of the current unit to the current position
    pointer and comparing this to the end position of the extradata. But
    pointer comparisons and pointer arithmetic are only defined if it does not
    exceed the object it is used on (one past the last element of an array
    is allowed, too). In practice, this might lead to overflows. Therefore
    the check has been changed to use bytestream2_get_bytes_left() which
    means that the pointers get subtracted and the result gets compared to
    the available size.
    
    Furthermore, the error code has been fixed.
    Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
    Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
    268dffc1
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...