History

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.

James Almer committed 1 year ago

Commit 1446e371 parent 658a6451 file · +5 −0Browse files

Unified · Split

libavfilter/buffersrc.c+5−0
@@ -421,6 +421,11 @@ static av_cold int init_audio(AVFilterContext *ctx) · 420 unmodified lines
421421 av_channel_layout_describe(&s->ch_layout, buf, sizeof(buf));
422422 }
423423
424+ if (s->sample_rate <= 0) {
425+ av_log(ctx, AV_LOG_ERROR, "Sample rate not set\n");
426+ return AVERROR(EINVAL);
427+ }
428+
424429 if (!s->time_base.num)
425430 s->time_base = (AVRational){1, s->sample_rate};
426431

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t