Opened 5 years ago

Closed 5 years ago

#8572 closed defect (fixed)

access violation using af_anequalizer filter

Reported by: DiZSl Owned by:
Priority: normal Component: avfilter
Version: git-master Keywords: anequalizer
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
By using a large number of af_anequalizer filters, you can get an error out of the array range.
The add_filter function in the filter has a comparison error

Now:
static int add_filter(AudioNEqualizerContext *s, AVFilterLink *inlink)
{

equalizer(&s->filters[s->nb_filters], inlink->sample_rate);
if (s->nb_filters >= s->nb_allocated) {

...

Must be:
static int add_filter(AudioNEqualizerContext *s, AVFilterLink *inlink)
{

equalizer(&s->filters[s->nb_filters], inlink->sample_rate);
if (s->nb_filters >= (s->nb_allocated - 1)) {

...

nb_allocated initialized as

s->nb_allocated = 32 * inlink->channels;

If you call the add_filter function more times, you will get an error because nb_filters is incremented after the above comparison.

Unfortunately I can't send you the patch and the command line to play the bug because I'm not familiar with the ffmpeg command system.

Change History (1)

comment:1 by Carl Eugen Hoyos, 5 years ago

Keywords: anequalizer added
Resolution: fixed
Status: newclosed
Version: unspecifiedgit-master
Note: See TracTickets for help on using tickets.