]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/opusdec: Return error upon error
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Mon, 28 Dec 2020 16:52:12 +0000 (17:52 +0100)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Thu, 31 Dec 2020 22:21:43 +0000 (23:21 +0100)
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>
libavcodec/opusdec.c

index 86a3181e9dafd1c32ea7b3d5b3e58900c0e4a282..462d70b3bf9b55b408a053f336cfe50b5c64b59a 100644 (file)
@@ -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);