diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-11-22 17:24:20 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-02-02 14:18:21 +0100 |
commit | be6695995d263e1462e41828d3446e6e47ce2511 (patch) | |
tree | 5dfe0a0114a4b2cd1c57a82ec24841f1b4871404 | |
parent | eeef4189a48f9b1c07275ba7b13d266c6134e0b0 (diff) | |
download | ffmpeg-be6695995d263e1462e41828d3446e6e47ce2511.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>
(cherry picked from commit b29d351f972f801d0374ca8565cee398b8f69160)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-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 a3809ba1c7..2eedc4edba 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; |