[FFmpeg-devel] [PATCH 1/3] cmdutils_opencl: fix resource_leak cid 1396852

Michael Niedermayer michael at niedermayer.cc
Wed Jan 11 21:29:38 EET 2017


On Tue, Jan 10, 2017 at 07:44:32PM +0800, Steven Liu wrote:
> CID: 1396852
> check the devices_list alloc status,
> and release the devices_list when alloc devices error
> 
> Signed-off-by: Steven Liu <lq at chinaffmpeg.org>
> ---
>  cmdutils_opencl.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/cmdutils_opencl.c b/cmdutils_opencl.c
> index dd21344..5bbc8dc 100644
> --- a/cmdutils_opencl.c
> +++ b/cmdutils_opencl.c
> @@ -220,15 +220,20 @@ int opt_opencl_bench(void *optctx, const char *opt, const char *arg)
>      OpenCLDeviceBenchmark *devices = NULL;
>      cl_platform_id platform;
>  
> -    av_opencl_get_device_list(&device_list);
> +    if (av_opencl_get_device_list(&device_list) < 0) {
> +        return AVERROR(ENOMEM);
> +    }

The error code from av_opencl_get_device_list() should be forwarded

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The educated differ from the uneducated as much as the living from the
dead. -- Aristotle 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170111/2fa9109b/attachment.sig>


More information about the ffmpeg-devel mailing list