From 8bcf5840ea2a6a92c75ab3219f89fe0b8a53cf50 Mon Sep 17 00:00:00 2001 From: Timo Rothenpieler Date: Sun, 12 Nov 2017 21:04:57 +0100 Subject: [PATCH] avcodec/nvdec: fix return value on error --- libavcodec/nvdec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/nvdec.c b/libavcodec/nvdec.c index 5d65f1d3dd..ac68faca99 100644 --- a/libavcodec/nvdec.c +++ b/libavcodec/nvdec.c @@ -414,8 +414,10 @@ int ff_nvdec_start_frame(AVCodecContext *avctx, AVFrame *frame) return AVERROR(ENOMEM); cf->decoder_ref = av_buffer_ref(ctx->decoder_ref); - if (!cf->decoder_ref) + if (!cf->decoder_ref) { + ret = AVERROR(ENOMEM); goto fail; + } cf->idx_ref = av_buffer_pool_get(ctx->decoder_pool); if (!cf->idx_ref) {