提交 8213f0a7 编写于 作者: P Paul B Mahol

avformat/vpk: check that samples_per_block is > 0

Fixes floating point exception.
上级 45a29029
...@@ -121,7 +121,10 @@ static int vpk_read_seek(AVFormatContext *s, int stream_index, ...@@ -121,7 +121,10 @@ static int vpk_read_seek(AVFormatContext *s, int stream_index,
int64_t ret = 0; int64_t ret = 0;
samples_per_block = av_get_audio_frame_duration2(par, par->block_align); samples_per_block = av_get_audio_frame_duration2(par, par->block_align);
timestamp /= samples_per_block; if (samples_per_block > 0)
timestamp /= samples_per_block;
else
return -1;
ret = avio_seek(s->pb, vpk->data_start + timestamp * par->block_align, SEEK_SET); ret = avio_seek(s->pb, vpk->data_start + timestamp * par->block_align, SEEK_SET);
if (ret < 0) if (ret < 0)
return ret; return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册