perform sanity check on number of channels in electronicarts demuxer
authorDaniel Kang <daniel.d.kang@gmail.com>
Mon, 10 Jan 2011 11:02:07 +0000 (11:02 +0000)
committerPeter Ross <pross@xvid.org>
Mon, 10 Jan 2011 11:02:07 +0000 (11:02 +0000)
Fixes issue2514
Original patch by Daniel Kang, daniel.d.kang at gmail

Originally committed as revision 26296 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/electronicarts.c

index df517df..249e5c8 100644 (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);