[FFmpeg-cvslog] electronicarts: Add more sanity checking for the number of channels

Martin Storsjö git at videolan.org
Thu Jan 16 22:29:50 CET 2014


ffmpeg | branch: release/0.10 | Martin Storsjö <martin at martin.st> | Sat Sep 28 23:38:40 2013 +0300| [416ad3ecf242946034a552f39718b6aaaa98c272] | committer: Luca Barbato

electronicarts: Add more sanity checking for the number of channels

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable at libav.org
Signed-off-by: Martin Storsjö <martin at martin.st>
(cherry picked from commit a9221e39600a31ee13e736e9e47743cde23f0280)
Signed-off-by: Luca Barbato <lu_zero at gentoo.org>

Conflicts:
	libavformat/electronicarts.c
(cherry picked from commit a89868d714705af1b0b004fa790a889e9ba792cd)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=416ad3ecf242946034a552f39718b6aaaa98c272
---

 libavformat/electronicarts.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavformat/electronicarts.c b/libavformat/electronicarts.c
index 0113683..fb8f718 100644
--- a/libavformat/electronicarts.c
+++ b/libavformat/electronicarts.c
@@ -424,8 +424,9 @@ static int ea_read_header(AVFormatContext *s,
     }
 
     if (ea->audio_codec) {
-        if (ea->num_channels <= 0) {
-            av_log(s, AV_LOG_WARNING, "Unsupported number of channels: %d\n", ea->num_channels);
+        if (ea->num_channels <= 0 || ea->num_channels > 2) {
+            av_log(s, AV_LOG_WARNING,
+                   "Unsupported number of channels: %d\n", ea->num_channels);
             ea->audio_codec = 0;
             return 1;
         }



More information about the ffmpeg-cvslog mailing list