mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-10-28 15:19:38 +03:00
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 a9221e3960)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Conflicts:
libavformat/electronicarts.c
This commit is contained in:
committed by
Luca Barbato
parent
607863acae
commit
a89868d714
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user