mirror of https://git.ffmpeg.org/ffmpeg.git
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>
This commit is contained in:
parent
4f1ae39036
commit
794fb18369
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue