X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fnvenc.c;h=4a91d9972014f97819aae740cbbc1060b8c1ba46;hb=c12c2739cd1eb3a84177a1dd39b526cbd5400927;hp=e07280b568274da41ceb114b7839e9aa83608b16;hpb=4e93f00b06d9623ea9639ba7185cdacdf11c2672;p=ffmpeg diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c index e07280b5682..4a91d997201 100644 --- a/libavcodec/nvenc.c +++ b/libavcodec/nvenc.c @@ -133,11 +133,11 @@ static av_cold int nvenc_load_libraries(AVCodecContext *avctx) uint32_t nvenc_max_ver; int ret; - ret = cuda_load_functions(&dl_fn->cuda_dl); + ret = cuda_load_functions(&dl_fn->cuda_dl, avctx); if (ret < 0) return ret; - ret = nvenc_load_functions(&dl_fn->nvenc_dl); + ret = nvenc_load_functions(&dl_fn->nvenc_dl, avctx); if (ret < 0) { nvenc_print_driver_requirement(avctx, AV_LOG_ERROR); return ret; @@ -1763,8 +1763,10 @@ static int process_output_surface(AVCodecContext *avctx, AVPacket *pkt, NvencSur } slice_offsets = av_mallocz(slice_mode_data * sizeof(*slice_offsets)); - if (!slice_offsets) + if (!slice_offsets) { + res = AVERROR(ENOMEM); goto error; + } lock_params.version = NV_ENC_LOCK_BITSTREAM_VER;