mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-10-19 09:53:18 +00:00
avfilter/buffersrc: check for valid sample rate
A sample rate <= 0 is invalid.
Fixes an assert in ffmpeg_enc.c that assumed a valid sample rate would be set.
Fixes ticket #11385.
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 1446e37d3d
)
This commit is contained in:
parent
3c34ce7cfe
commit
20dee7be59
1 changed files with 5 additions and 0 deletions
|
@ -372,6 +372,11 @@ static av_cold int init_audio(AVFilterContext *ctx)
|
|||
if (!(s->fifo = av_fifo_alloc(sizeof(AVFrame*))))
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
if (s->sample_rate <= 0) {
|
||||
av_log(ctx, AV_LOG_ERROR, "Sample rate not set\n");
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
if (!s->time_base.num)
|
||||
s->time_base = (AVRational){1, s->sample_rate};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue