Browse Source

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 0a56bfa71f.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
master
Andreas Rheinhardt 4 years ago
parent
commit
652279e35b
1 changed files with 2 additions and 4 deletions
  1. +2
    -4
      libavcodec/nellymoserenc.c

+ 2
- 4
libavcodec/nellymoserenc.c View File

@@ -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);



Loading…
Cancel
Save