Fixes: out of array access Fixes: tickets/10746/poc13ffmpeg
Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -74,6 +74,8 @@ static int config_input(AVFilterLink *inlink) · 73 unmodified lines | |||
| 74 | 74 | ||
| 75 | s->length = lrintf(s->delay * inlink->sample_rate / 1000); | 75 | s->length = lrintf(s->delay * inlink->sample_rate / 1000); |
| 76 | s->length *= 2; | 76 | s->length *= 2; |
| 77 | if (s->length == 0) | ||
| 78 | return AVERROR(EINVAL); | ||
| 77 | s->buffer = av_calloc(s->length, sizeof(*s->buffer)); | 79 | s->buffer = av_calloc(s->length, sizeof(*s->buffer)); |
| 78 | if (!s->buffer) | 80 | if (!s->buffer) |
| 79 | return AVERROR(ENOMEM); | 81 | return AVERROR(ENOMEM); |