diff options
author | Timo Rothenpieler <timo@rothenpieler.org> | 2018-01-28 13:05:09 +0100 |
---|---|---|
committer | Timo Rothenpieler <timo@rothenpieler.org> | 2018-01-28 13:05:09 +0100 |
commit | 932037c6bb6b41a24e75b031426844a2e6472a74 (patch) | |
tree | 3fb2148e7b3e1d5822ac02b2dffd96620684d9d0 /libavcodec | |
parent | 48e52e4edd12adbc36eee0eebe1b97ffe0255be3 (diff) | |
download | ffmpeg-932037c6bb6b41a24e75b031426844a2e6472a74.tar.gz |
avcodec/nvenc: also clear data pointer after unregistering a resource
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/nvenc.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c index 7038a49d90..39c3aa1fbb 100644 --- a/libavcodec/nvenc.c +++ b/libavcodec/nvenc.c @@ -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; |