Skip to content

Commit

Permalink
avformat/mvdec: Check bytes_per_sample
Browse files Browse the repository at this point in the history
Fixes: division by zero
Fixes: 42814/clusterfuzz-testcase-minimized-ffmpeg_dem_MV_fuzzer-4787014237552640

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <[email protected]>
Reviewed-by: John-Paul Stewart <[email protected]>
Signed-off-by: Michael Niedermayer <[email protected]>
  • Loading branch information
michaelni committed Dec 25, 2021
1 parent 10add8b commit f3a949d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libavformat/mvdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,9 @@ static int mv_read_header(AVFormatContext *avctx)
avpriv_request_sample(avctx, "Audio compression (format %i)", v);
}

if (bytes_per_sample == 0)
return AVERROR_INVALIDDATA;

if (set_channels(avctx, ast, avio_rb32(pb)) < 0)
return AVERROR_INVALIDDATA;

Expand Down

0 comments on commit f3a949d

Please sign in to comment.