perform sanity check on number of channels in electronicarts demuxer

Fixes issue2514
Original patch by Daniel Kang, daniel.d.kang at gmail

Originally committed as revision 26296 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Daniel Kang 2011-01-10 11:02:07 +00:00 committed by Peter Ross
parent 2843502ea4
commit 4da766ce65
1 changed files with 5 additions and 0 deletions

View File

@ -422,6 +422,11 @@ static int ea_read_header(AVFormatContext *s,
st->codec->height = ea->height;
}
if (ea->num_channels <= 0) {
av_log(s, AV_LOG_WARNING, "Unsupported number of channels: %d\n", ea->num_channels);
ea->audio_codec = 0;
}
if (ea->audio_codec) {
/* initialize the audio decoder stream */
st = av_new_stream(s, 0);