Commit 1db03a68 authored by Anton Khirnov's avatar Anton Khirnov

lavr: return an error if a avresample_open() is called on an open context

parent 7e86c27b
......@@ -36,6 +36,11 @@ int avresample_open(AVAudioResampleContext *avr)
{
int ret;
if (avresample_is_open(avr)) {
av_log(avr, AV_LOG_ERROR, "The resampling context is already open.\n");
return AVERROR(EINVAL);
}
/* set channel mixing parameters */
avr->in_channels = av_get_channel_layout_nb_channels(avr->in_channel_layout);
if (avr->in_channels <= 0 || avr->in_channels > AVRESAMPLE_MAX_CHANNELS) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment