aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-11-22 17:24:20 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2020-12-09 21:41:15 +0100
commitb29d351f972f801d0374ca8565cee398b8f69160 (patch)
tree5ead3bae5adfb007a44982e48f63451d2c24a5b1 /libavformat
parent0e62efad7cd6b1fa07dcb3badb6ab92957a576dc (diff)
downloadffmpeg-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.c4
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;