#8572: access violation using af_anequalizer filter
----------------------------------+---------------------------------------
             Reporter:  DiZSl     |                     Type:  defect
               Status:  new       |                 Priority:  normal
            Component:  avfilter  |                  Version:  unspecified
             Keywords:            |               Blocked By:
             Blocking:            |  Reproduced by developer:  0
Analyzed by developer:  0         |
----------------------------------+---------------------------------------
 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.

--
Ticket URL: <https://trac.ffmpeg.org/ticket/8572>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
_______________________________________________
FFmpeg-trac mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-trac

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Reply via email to