Commit 932037c6 authored by Timo Rothenpieler's avatar Timo Rothenpieler

avcodec/nvenc: also clear data pointer after unregistering a resource

Signed-off-by: 's avatarTimo Rothenpieler <timo@rothenpieler.org>
parent 48e52e4e
......@@ -1540,6 +1540,7 @@ static int nvenc_find_free_reg_resource(AVCodecContext *avctx)
nv_status = p_nvenc->nvEncUnregisterResource(ctx->nvencoder, ctx->registered_frames[i].regptr);
if (nv_status != NV_ENC_SUCCESS)
return nvenc_print_error(avctx, nv_status, "Failed unregistering unused input resource");
ctx->registered_frames[i].ptr = NULL;
ctx->registered_frames[i].regptr = NULL;
}
return i;
......@@ -1810,6 +1811,7 @@ static int process_output_surface(AVCodecContext *avctx, AVPacket *pkt, NvencSur
res = nvenc_print_error(avctx, nv_status, "Failed unregistering input resource");
goto error;
}
ctx->registered_frames[tmpoutsurf->reg_idx].ptr = NULL;
ctx->registered_frames[tmpoutsurf->reg_idx].regptr = NULL;
} else if (ctx->registered_frames[tmpoutsurf->reg_idx].mapped < 0) {
res = AVERROR_BUG;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment