vlc | branch: master | Quentin Chateau <[email protected]> | Mon Mar 23 18:11:40 2020 +0100| [f79d8a5b975e47fc29b5fd1ae28bf088530daaaa] | committer: Steve Lhomme
nvdec: added missing CUDA context pop in error path Signed-off-by: Steve Lhomme <[email protected]> > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f79d8a5b975e47fc29b5fd1ae28bf088530daaaa --- modules/hw/nvdec/nvdec.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/hw/nvdec/nvdec.c b/modules/hw/nvdec/nvdec.c index 321815071d..d2ec909fbc 100644 --- a/modules/hw/nvdec/nvdec.c +++ b/modules/hw/nvdec/nvdec.c @@ -227,7 +227,7 @@ static int CUDAAPI HandleVideoSequence(void *p_opaque, CUVIDEOFORMAT *p_format) }; ret = CALL_CUVID(cuvidCreateDecoder, &p_sys->cudecoder, &dparams); if (ret != VLC_SUCCESS) - goto error; + goto cuda_error; // ensure the output surfaces have the same pitch so copies can work properly if ( is_nvdec_opaque(p_dec->fmt_out.video.i_chroma) ) @@ -240,7 +240,7 @@ static int CUDAAPI HandleVideoSequence(void *p_opaque, CUVIDEOFORMAT *p_format) }; ret = CALL_CUVID( cuvidMapVideoFrame, p_sys->cudecoder, 0, &frameDevicePtr, &p_sys->outputPitch, ¶ms ); if (ret != VLC_SUCCESS) - goto error; + goto cuda_error; CALL_CUVID(cuvidUnmapVideoFrame, p_sys->cudecoder, frameDevicePtr); unsigned int ByteWidth = p_sys->outputPitch; @@ -294,7 +294,7 @@ clean_pics: break; } if (ret != VLC_SUCCESS) - goto error; + goto cuda_error; p_sys->out_pool = picture_pool_New( ARRAY_SIZE(p_sys->outputDevicePtr), pics ); } @@ -305,6 +305,9 @@ clean_pics: ret = decoder_UpdateVideoOutput(p_dec, p_sys->vctx_out); return (ret == VLC_SUCCESS); + +cuda_error: + CALL_CUDA_DEC(cuCtxPopCurrent, NULL); error: p_sys->b_nvparser_success = false; return 0; _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
