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