summaryrefslogtreecommitdiff
path: root/libavcodec/nellymoserenc.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-04-15 15:48:34 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-04-15 18:15:57 +0200
commit652279e35becae7b4c0b6b73e4f6c074e8a8b77c (patch)
tree192e8eee3034b04e2e110d10fedb81bb6f91633c /libavcodec/nellymoserenc.c
parent918273aa3eb721323ec2de37a39ad8ce9f4dcfb7 (diff)
downloadffmpeg-652279e35becae7b4c0b6b73e4f6c074e8a8b77c.tar.gz
avcodec/nellymoserenc: Fix segfault when using unsupported channels/rate
NellyMoserEncodeContext.avctx is only set in init after these checks, yet it is used by encode_end(). This is a regression since 0a56bfa71f751a2b25da8d060a019c1c75ca9d7b. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/nellymoserenc.c')
-rw-r--r--libavcodec/nellymoserenc.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/libavcodec/nellymoserenc.c b/libavcodec/nellymoserenc.c
index 99ede2f42b..8670431dcc 100644
--- a/libavcodec/nellymoserenc.c
+++ b/libavcodec/nellymoserenc.c
@@ -138,10 +138,8 @@ static av_cold int encode_end(AVCodecContext *avctx)
ff_mdct_end(&s->mdct_ctx);
- if (s->avctx->trellis) {
- av_freep(&s->opt);
- av_freep(&s->path);
- }
+ av_freep(&s->opt);
+ av_freep(&s->path);
ff_af_queue_close(&s->afq);
av_freep(&s->fdsp);