summaryrefslogtreecommitdiff
path: root/libavresample
diff options
context:
space:
mode:
Diffstat (limited to 'libavresample')
-rw-r--r--libavresample/utils.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavresample/utils.c b/libavresample/utils.c
index 306b67c7ad..63d653058c 100644
--- a/libavresample/utils.c
+++ b/libavresample/utils.c
@@ -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) {