[FFmpeg-cvslog] avformat/vividas: Make len signed
Michael Niedermayer
git at videolan.org
Wed Dec 9 22:42:10 EET 2020
ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sun Nov 22 17:24:20 2020 +0100| [b29d351f972f801d0374ca8565cee398b8f69160] | committer: Michael Niedermayer
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 at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b29d351f972f801d0374ca8565cee398b8f69160
---
libavformat/vividas.c | 4 ++--
1 file 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;
More information about the ffmpeg-cvslog
mailing list