aboutsummaryrefslogtreecommitdiffstats
path: root/libavresample
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2012-06-01 15:12:03 -0400
committerJustin Ruggles <justin.ruggles@gmail.com>2012-07-08 15:22:11 -0400
commitdb0e7bd0bd1344b0edfd6a779e832fcd47cacd00 (patch)
tree20745f5329878bdbca89697d6914ee11d54351fc /libavresample
parent66a297975d19e0d9b8a5ff8a723dcd2116a506ce (diff)
downloadffmpeg-db0e7bd0bd1344b0edfd6a779e832fcd47cacd00.tar.gz
lavr: mix: validate internal sample format in ff_audio_mix_init()
Diffstat (limited to 'libavresample')
-rw-r--r--libavresample/audio_mix.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavresample/audio_mix.c b/libavresample/audio_mix.c
index 93192221cd..2c2a356844 100644
--- a/libavresample/audio_mix.c
+++ b/libavresample/audio_mix.c
@@ -305,6 +305,14 @@ int ff_audio_mix_init(AVAudioResampleContext *avr)
{
int ret;
+ if (avr->internal_sample_fmt != AV_SAMPLE_FMT_S16P &&
+ avr->internal_sample_fmt != AV_SAMPLE_FMT_FLTP) {
+ av_log(avr, AV_LOG_ERROR, "Unsupported internal format for "
+ "mixing: %s\n",
+ av_get_sample_fmt_name(avr->internal_sample_fmt));
+ return AVERROR(EINVAL);
+ }
+
/* build matrix if the user did not already set one */
if (!avr->am->matrix) {
int i, j;