Commit feb15cee authored by Shitiz Garg's avatar Shitiz Garg Committed by Justin Ruggles

mtv: Make sure audio_subsegments is not 0

audio_subsegments would be 0 and cause floating point exceptions
Fixes bugzilla #144
Signed-off-by: 's avatarJustin Ruggles <justin.ruggles@gmail.com>
parent f13a9ca9
......@@ -106,6 +106,12 @@ static int mtv_read_header(AVFormatContext *s, AVFormatParameters *ap)
avio_skip(pb, 4);
audio_subsegments = avio_rl16(pb);
if (audio_subsegments == 0) {
av_log_ask_for_sample(s, "MTV files without audio are not supported\n");
return AVERROR_INVALIDDATA;
}
mtv->full_segment_size =
audio_subsegments * (MTV_AUDIO_PADDING_SIZE + MTV_ASUBCHUNK_DATA_SIZE) +
mtv->img_segment_size;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment