aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2013-09-28 23:38:40 +0300
committerLuca Barbato <lu_zero@gentoo.org>2013-10-04 03:52:09 +0200
commita89868d714705af1b0b004fa790a889e9ba792cd (patch)
tree7bf26f8add5de0abf02ac83dca52c2d99c903228
parent607863acaec85671f8c2afd81079ae4c605e3468 (diff)
downloadffmpeg-a89868d714705af1b0b004fa790a889e9ba792cd.tar.gz
electronicarts: Add more sanity checking for the number of channels
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st> (cherry picked from commit a9221e39600a31ee13e736e9e47743cde23f0280) Signed-off-by: Luca Barbato <lu_zero@gentoo.org> Conflicts: libavformat/electronicarts.c
-rw-r--r--libavformat/electronicarts.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/electronicarts.c b/libavformat/electronicarts.c
index ebb4c124dd..b85b4c2678 100644
--- a/libavformat/electronicarts.c
+++ b/libavformat/electronicarts.c
@@ -439,8 +439,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;
}