diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2019-12-14 23:19:16 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-03-06 00:58:31 +0100 |
commit | 268dffc12b3f5466d0ca971591f5f13ec6d33db6 (patch) | |
tree | aed35edc0d8953e62b5d26ec5b12693da85e25a5 /libavcodec/tests/codec_desc.c | |
parent | 0ccb31f1356ed306febd74cb6d691017f20a1891 (diff) | |
download | ffmpeg-268dffc12b3f5466d0ca971591f5f13ec6d33db6.tar.gz |
h264_mp4toannexb: Improve extradata overread checks
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: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/tests/codec_desc.c')
0 files changed, 0 insertions, 0 deletions