提交 790f4dd5 编写于 作者: L Laurent Aimar 提交者: Janne Grunau

Fixed segfault on corrupted sega streams in the demuxer.

Signed-off-by: NJanne Grunau <janne-libav@jannau.net>
上级 69a0bce7
......@@ -176,6 +176,8 @@ static int film_read_header(AVFormatContext *s,
if(film->sample_count >= UINT_MAX / sizeof(film_sample))
return -1;
film->sample_table = av_malloc(film->sample_count * sizeof(film_sample));
if (!film->sample_table)
return AVERROR(ENOMEM);
for(i=0; i<s->nb_streams; i++)
av_set_pts_info(s->streams[i], 33, 1, film->base_clock);
......@@ -199,7 +201,7 @@ static int film_read_header(AVFormatContext *s,
if (film->audio_type == CODEC_ID_ADPCM_ADX)
audio_frame_counter += (film->sample_table[i].sample_size * 32 /
(18 * film->audio_channels));
else
else if (film->audio_type != CODEC_ID_NONE)
audio_frame_counter += (film->sample_table[i].sample_size /
(film->audio_channels * film->audio_bits / 8));
} else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册