diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-11-22 17:24:20 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-12-09 21:41:15 +0100 |
commit | b29d351f972f801d0374ca8565cee398b8f69160 (patch) | |
tree | 5ead3bae5adfb007a44982e48f63451d2c24a5b1 /libavformat | |
parent | 0e62efad7cd6b1fa07dcb3badb6ab92957a576dc (diff) | |
download | ffmpeg-b29d351f972f801d0374ca8565cee398b8f69160.tar.gz |
avformat/vividas: Make len signed
Fixes: out of array access
Fixes: 27424/clusterfuzz-testcase-minimized-ffmpeg_dem_VIVIDAS_fuzzer-5682070692823040
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/vividas.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/vividas.c b/libavformat/vividas.c index 46c66bf9a0..4adc125439 100644 --- a/libavformat/vividas.c +++ b/libavformat/vividas.c @@ -389,8 +389,8 @@ static int track_header(VividasDemuxContext *viv, AVFormatContext *s, uint8_t * ffio_read_varlen(pb); // len_3 num_data = avio_r8(pb); for (j = 0; j < num_data; j++) { - uint64_t len = ffio_read_varlen(pb); - if (len > INT_MAX/2 - xd_size) { + int64_t len = ffio_read_varlen(pb); + if (len < 0 || len > INT_MAX/2 - xd_size) { return AVERROR_INVALIDDATA; } data_len[j] = len; |