Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-07-13 04:40:25 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2015-07-13 04:51:33 +0300
commit10d7d0880cd849caa81a872d2e01948ef7369485 (patch)
tree230a5abc28860491c396231b7542976def840bae /libavcodec/utils.c
parent7c944b0a36701359489906483672fe9f7111ff0c (diff)
avcodec/utils: Check that the sample rate is not negative when opening an encoder
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r--libavcodec/utils.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index f34490312d..07017863fb 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1576,6 +1576,12 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
goto free_and_end;
}
}
+ if (avctx->sample_rate < 0) {
+ av_log(avctx, AV_LOG_ERROR, "Specified sample rate %d is not supported\n",
+ avctx->sample_rate);
+ ret = AVERROR(EINVAL);
+ goto free_and_end;
+ }
if (avctx->codec->channel_layouts) {
if (!avctx->channel_layout) {
av_log(avctx, AV_LOG_WARNING, "Channel layout not specified\n");