aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2024-03-18 23:35:26 +0100
committerMarton Balint <cus@passwd.hu>2024-03-24 21:27:55 +0100
commit2f754a96bd4ae4932923fe03c2d53f8273b6273c (patch)
tree145fcbe20eca102ebe491e628af0f6c8f162007a
parent1bea3e9ee2f3521182eea6066fc8e8e1f8910c5b (diff)
downloadffmpeg-2f754a96bd4ae4932923fe03c2d53f8273b6273c.tar.gz
avfilter/af_channelmap: disallow channel index 64
MAX_CH is 64, therefore the maximum index is 63. Signed-off-by: Marton Balint <cus@passwd.hu>
-rw-r--r--libavfilter/af_channelmap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavfilter/af_channelmap.c b/libavfilter/af_channelmap.c
index 35dc4c4618..1ecbddd462 100644
--- a/libavfilter/af_channelmap.c
+++ b/libavfilter/af_channelmap.c
@@ -84,7 +84,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;
@@ -98,7 +98,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;