]> git.sesse.net Git - ffmpeg/commit
avfilter/af_headphone: Don't use uninitialized buffer in log message
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Mon, 24 Aug 2020 04:08:56 +0000 (06:08 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Wed, 9 Sep 2020 11:36:54 +0000 (13:36 +0200)
commite2d4a5807fa5914185dc6f3ae0a4d63cd8fe3b29
treedc092ed81812d59d7914a2e570511048dad3dc16
parent3c7cad69f233252e5178f7732baa0da950d74bbd
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>
libavfilter/af_headphone.c