History

mtv: Make sure audio_subsegments is not 0

audio_subsegments would be 0 and cause floating point exceptions Fixes bugzilla #144

Shitiz Garg committed 14 years ago

Commit feb15ce1 parent f13a9ca1 file · +6 −0Browse files

Unified · Split

libavformat/mtv.c+6−0
@@ -106,6 +106,12 @@ static int mtv_read_header(AVFormatContext *s, AVFormatParameters *ap) · 105 unmodified lines
106 106
107 avio_skip(pb, 4);107 avio_skip(pb, 4);
108 audio_subsegments = avio_rl16(pb);108 audio_subsegments = avio_rl16(pb);
109
110 if (audio_subsegments == 0) {
111 av_log_ask_for_sample(s, "MTV files without audio are not supported\n");
112 return AVERROR_INVALIDDATA;
113 }
114
109 mtv->full_segment_size =115 mtv->full_segment_size =
110 audio_subsegments * (MTV_AUDIO_PADDING_SIZE + MTV_ASUBCHUNK_DATA_SIZE) +116 audio_subsegments * (MTV_AUDIO_PADDING_SIZE + MTV_ASUBCHUNK_DATA_SIZE) +
111 mtv->img_segment_size;117 mtv->img_segment_size;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t