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

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

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

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