diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2019-05-17 00:29:50 +0200 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2019-06-22 23:43:38 -0300 |
commit | e5ec1318562cba507171e4af74da65d2d45764dd (patch) | |
tree | 3fe0d058b9449341c69fe7aed1dc3524b92fb2e1 /libavformat/matroskadec.c | |
parent | 07d4056052081b0157cf529dc2708834f8df9885 (diff) | |
download | ffmpeg-e5ec1318562cba507171e4af74da65d2d45764dd.tar.gz |
avformat/matroskadec: Use generic size check for signed integers
and drop the redundant checks contained in ebml_read_uint and
ebml_read_sint.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavformat/matroskadec.c')
-rw-r--r-- | libavformat/matroskadec.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 7ae73fda35..cb6908bf35 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -882,9 +882,6 @@ static int ebml_read_uint(AVIOContext *pb, int size, uint64_t *num) { int n = 0; - if (size > 8) - return AVERROR_INVALIDDATA; - /* big-endian ordering; build up number */ *num = 0; while (n++ < size) @@ -901,9 +898,6 @@ static int ebml_read_sint(AVIOContext *pb, int size, int64_t *num) { int n = 1; - if (size > 8) - return AVERROR_INVALIDDATA; - if (size == 0) { *num = 0; } else { @@ -1161,6 +1155,7 @@ static int ebml_parse_elem(MatroskaDemuxContext *matroska, { static const uint64_t max_lengths[EBML_TYPE_COUNT] = { [EBML_UINT] = 8, + [EBML_SINT] = 8, [EBML_FLOAT] = 8, // max. 16 MB for strings [EBML_STR] = 0x1000000, |