avfilter/af_alimiter: Check nextpos before use

Fixes: out of array read
Fixes: tickets/10744/poc11ffmpeg

Found-by: Li Zeyuan and Zeng Yunxiang.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a88b06f9ee)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
pull/390/head
Michael Niedermayer 1 year ago
parent e01a55c528
commit e43a3d8d30
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
  1. 1
      libavfilter/af_alimiter.c

@ -195,6 +195,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
int j = i % buffer_size;
double ppeak = 0, pdelta;
if (nextpos[j] >= 0)
for (c = 0; c < channels; c++) {
ppeak = FFMAX(ppeak, fabs(buffer[nextpos[j] + c]));
}

Loading…
Cancel
Save