Browse Source

avformat/vividas: better check of current_sb_entry

This is the simplest fix for the problem, it is possible to instead check
this when the variables are set and propagate errors and then fail earlier

Fixes: out of array access
Fixes: 26490/clusterfuzz-testcase-minimized-ffmpeg_dem_VIVIDAS_fuzzer-5723367078100992

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n4.4
Michael Niedermayer 4 years ago
parent
commit
b848baef0d
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      libavformat/vividas.c

+ 4
- 0
libavformat/vividas.c View File

@@ -673,6 +673,10 @@ static int viv_read_packet(AVFormatContext *s,
if (!pb)
return AVERROR(EIO);
off = avio_tell(pb);

if (viv->current_sb_entry >= viv->n_sb_entries)
return AVERROR_INVALIDDATA;

off += viv->sb_entries[viv->current_sb_entry].size;

if (viv->sb_entries[viv->current_sb_entry].flag == 0) {


Loading…
Cancel
Save