Skip to content

Commit 2d0ee12

Browse files
committed
avcodec/nvdec: Push the context before destroying the decoder
This has no visible effects but I happened to run under the cuda memcheck tool and it called it out as an error.
1 parent 22d6d91 commit 2d0ee12

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

libavcodec/nvdec.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,12 @@ static void nvdec_decoder_free(void *opaque, uint8_t *data)
149149
{
150150
NVDECDecoder *decoder = (NVDECDecoder*)data;
151151

152-
if (decoder->decoder)
152+
if (decoder->decoder) {
153+
CUcontext dummy;
154+
decoder->cudl->cuCtxPushCurrent(decoder->cuda_ctx);
153155
decoder->cvdl->cuvidDestroyDecoder(decoder->decoder);
156+
decoder->cudl->cuCtxPopCurrent(&dummy);
157+
}
154158

155159
av_buffer_unref(&decoder->hw_device_ref);
156160

0 commit comments

Comments
 (0)