aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-08-24 06:08:56 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2021-02-27 07:21:00 +0100
commite212f0c00077dae75d662caa296b94df96e6e2c4 (patch)
tree8218c6b73ba54e29c21487c6d12aa5c05c98c781
parent262162883a0c5b17050489381f8a6de7d9eeae66 (diff)
downloadffmpeg-e212f0c00077dae75d662caa296b94df96e6e2c4.tar.gz
avfilter/af_headphone: Don't use uninitialized buffer in log message
This buffer was supposed to be initialized by sscanf(input, "%7[A-Z]%n", buf, &len), yet if the first input character is not in the A-Z range, buf is not touched (in particular it needn't be zero-terminated if the failure happened when parsing the first channel and it still contains the last channel name if the failure happened when one channel name could be successfully parsed). This is treated as error in which case buf is used directly in the log message. This commit fixes this by actually using the string that could not be matched in the log message instead. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> (cherry picked from commit e2d4a5807fa5914185dc6f3ae0a4d63cd8fe3b29)
-rw-r--r--libavfilter/af_headphone.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavfilter/af_headphone.c b/libavfilter/af_headphone.c
index da5acdce30..72d4a7beb7 100644
--- a/libavfilter/af_headphone.c
+++ b/libavfilter/af_headphone.c
@@ -135,7 +135,7 @@ static void parse_map(AVFilterContext *ctx)
p = NULL;
if (parse_channel_name(s, s->nb_irs, &arg, &out_ch_id, buf)) {
- av_log(ctx, AV_LOG_WARNING, "Failed to parse \'%s\' as channel name.\n", buf);
+ av_log(ctx, AV_LOG_WARNING, "Failed to parse \'%s\' as channel name.\n", arg);
continue;
}
s->mapping[s->nb_irs] = out_ch_id;