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 commita9221e3960) Signed-off-by: Luca Barbato <lu_zero@gentoo.org> Conflicts: libavformat/electronicarts.c (cherry picked from commita89868d714)
This commit is contained in:
committed by
Luca Barbato
parent
7fdb915fc7
commit
416ad3ecf2
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user