[FFmpeg-cvslog] avfilter/af_channelmap: disallow channel index 64
Marton Balint
git at videolan.org
Sat Mar 30 23:25:31 EET 2024
ffmpeg | branch: release/5.1 | Marton Balint <cus at passwd.hu> | Mon Mar 18 23:35:26 2024 +0100| [19c3f055b2e29632be2f8e99e7b26b4f597c0173] | committer: Marton Balint
avfilter/af_channelmap: disallow channel index 64
MAX_CH is 64, therefore the maximum index is 63.
Signed-off-by: Marton Balint <cus at passwd.hu>
(cherry picked from commit 2f754a96bd4ae4932923fe03c2d53f8273b6273c)
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=19c3f055b2e29632be2f8e99e7b26b4f597c0173
---
libavfilter/af_channelmap.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavfilter/af_channelmap.c b/libavfilter/af_channelmap.c
index aa2468f941..18355eb43b 100644
--- a/libavfilter/af_channelmap.c
+++ b/libavfilter/af_channelmap.c
@@ -85,7 +85,7 @@ static char* split(char *message, char delim) {
return next;
}
-static int get_channel_idx(char **map, int *ch, char delim, int max_ch)
+static int get_channel_idx(char **map, int *ch, char delim, int max_nb_channels)
{
char *next;
int len;
@@ -99,7 +99,7 @@ static int get_channel_idx(char **map, int *ch, char delim, int max_ch)
sscanf(*map, "%d%n", ch, &n);
if (n != len)
return AVERROR(EINVAL);
- if (*ch < 0 || *ch > max_ch)
+ if (*ch < 0 || *ch >= max_nb_channels)
return AVERROR(EINVAL);
*map = next;
return 0;
More information about the ffmpeg-cvslog
mailing list