mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-10-24 02:09:03 +03:00
avcodec/nvdec: don't double free the fdd-owned context on the sep_ref error path
Fixes: double free Fixes: rpSz7v3yq2u8 Fixes:72982f8cb5(avcodec/nvdec: add support for separate reference frame) Found-by: Pavel Kohout (Aisle Research) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit4c6217477f) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -627,8 +627,7 @@ int ff_nvdec_start_frame_sep_ref(AVCodecContext *avctx, AVFrame *frame, int has_
|
||||
cf->ref_idx_ref = av_refstruct_pool_get(ctx->decoder_pool);
|
||||
if (!cf->ref_idx_ref) {
|
||||
av_log(avctx, AV_LOG_ERROR, "No decoder surfaces left\n");
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto fail;
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
}
|
||||
cf->ref_idx = *cf->ref_idx_ref;
|
||||
@@ -638,9 +637,6 @@ int ff_nvdec_start_frame_sep_ref(AVCodecContext *avctx, AVFrame *frame, int has_
|
||||
}
|
||||
|
||||
return 0;
|
||||
fail:
|
||||
nvdec_fdd_priv_free(cf);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ff_nvdec_end_frame(AVCodecContext *avctx)
|
||||
|
||||
Reference in New Issue
Block a user