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>
release/5.1
Andreas Rheinhardt 3 years ago
parent 9e241bdffd
commit ac7dc20a5d
  1. 2
      libavfilter/af_join.c

@ -252,7 +252,7 @@ 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,
memmove(chl->ch + idx, chl->ch + idx + 1,
(chl->nb_ch - idx - 1) * sizeof(*chl->ch));
chl->nb_ch--;
return ret;

Loading…
Cancel
Save