diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-12-28 17:52:12 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-12-31 23:21:43 +0100 |
commit | 794fb18369be7dae9f9844c83040bb06611ff890 (patch) | |
tree | 72d9ae778db4b9f6b0b41968e3ca99d63ce95c44 | |
parent | 4f1ae39036fa7ca587aca390dea1c0b4126eda0e (diff) | |
download | ffmpeg-794fb18369be7dae9f9844c83040bb06611ff890.tar.gz |
avcodec/opusdec: Return error upon error
The Opus decoder forgot to return an error when allocating an
SwrContext fails.
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
-rw-r--r-- | libavcodec/opusdec.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/opusdec.c b/libavcodec/opusdec.c index 86a3181e9d..462d70b3bf 100644 --- a/libavcodec/opusdec.c +++ b/libavcodec/opusdec.c @@ -671,8 +671,10 @@ static av_cold int opus_decode_init(AVCodecContext *avctx) s->fdsp = c->fdsp; s->swr =swr_alloc(); - if (!s->swr) + if (!s->swr) { + ret = AVERROR(ENOMEM); goto fail; + } layout = (s->output_channels == 1) ? AV_CH_LAYOUT_MONO : AV_CH_LAYOUT_STEREO; av_opt_set_int(s->swr, "in_sample_fmt", avctx->sample_fmt, 0); |