avfilter/af_join: Don't use memcpy for overlapping regions

Reported by ASAN as memcpy-param-overlap when running
the filter-join FATE-test.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2022-03-15 15:58:35 +01:00
parent 9e241bdffd
commit ac7dc20a5d
1 changed files with 2 additions and 2 deletions

View File

@ -252,8 +252,8 @@ typedef struct ChannelList {
static enum AVChannel channel_list_pop(ChannelList *chl, int idx)
{
enum AVChannel ret = chl->ch[idx];
memcpy(chl->ch + idx, chl->ch + idx + 1,
(chl->nb_ch - idx - 1) * sizeof(*chl->ch));
memmove(chl->ch + idx, chl->ch + idx + 1,
(chl->nb_ch - idx - 1) * sizeof(*chl->ch));
chl->nb_ch--;
return ret;
}