mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-26 01:02:33 +00:00
avformat/rka: Fix 1/0 with bps=1
Fixes: division by zero Fixes: 55940/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-6333107679920128 The decoder does not support bps=1 and i have no such sample so it is not known if this duration is correct. Alternatively we could error out on all bps we currently do not support on the decoder side or not set duration. 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:
parent
53c1f5c2e2
commit
b3df7ca748
@ -114,7 +114,7 @@ static int rka_read_header(AVFormatContext *s)
|
|||||||
par->ch_layout.nb_channels = channels;
|
par->ch_layout.nb_channels = channels;
|
||||||
par->sample_rate = samplerate;
|
par->sample_rate = samplerate;
|
||||||
par->bits_per_raw_sample = bps;
|
par->bits_per_raw_sample = bps;
|
||||||
st->duration = nb_samples / (channels * (bps >> 3));
|
st->duration = 8LL*nb_samples / (channels * bps);
|
||||||
|
|
||||||
if (s->pb->seekable & AVIO_SEEKABLE_NORMAL)
|
if (s->pb->seekable & AVIO_SEEKABLE_NORMAL)
|
||||||
ff_ape_parse_tag(s);
|
ff_ape_parse_tag(s);
|
||||||
|
Loading…
Reference in New Issue
Block a user