summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2019-12-14 23:19:17 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2020-03-06 00:58:31 +0100
commit015950596cdca08b692defedd56c5c4761e81749 (patch)
treea824b978ada73f986f823b8ecc224b9419d950ed /libavcodec
parent268dffc12b3f5466d0ca971591f5f13ec6d33db6 (diff)
h264_mp4toannexb: Add a comment about possible overread
Before reading a 16bit size field during parsing of extradata, no check is performed to make sure that said length field is actually contained in the extradata. Given that this overread is not dangerous (the extradata is supposed to be padded), only a comment for it has been added; the error itself will be detected as part of the normal check for overreads. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/h264_mp4toannexb_bsf.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/h264_mp4toannexb_bsf.c b/libavcodec/h264_mp4toannexb_bsf.c
index b9c6b165af..f809c6b3ad 100644
--- a/libavcodec/h264_mp4toannexb_bsf.c
+++ b/libavcodec/h264_mp4toannexb_bsf.c
@@ -98,6 +98,7 @@ static int h264_extradata_to_annexb(AVBSFContext *ctx, const int padding)
while (unit_nb--) {
int err;
+ /* possible overread ok due to padding */
unit_size = bytestream2_get_be16u(gb);
total_size += unit_size + 4;
av_assert1(total_size <= INT_MAX - padding);