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>
This commit is contained in:
Michael Niedermayer 2020-11-22 17:24:20 +01:00
parent 0e62efad7c
commit b29d351f97
1 changed files with 2 additions and 2 deletions

View File

@ -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;