X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=cmdutils_opencl.c;h=3dfd156195eaae3484068034791b7130c94ac46e;hb=4cc0f79a2c11f4ef53ee1b1199896832915a668e;hp=0fa8cc0ada7b4dbf21c0d353d38476f20aa6ddfd;hpb=b9bfd888e551644c54971220ebf1f37effba4769;p=ffmpeg diff --git a/cmdutils_opencl.c b/cmdutils_opencl.c index 0fa8cc0ada7..3dfd156195e 100644 --- a/cmdutils_opencl.c +++ b/cmdutils_opencl.c @@ -224,7 +224,7 @@ int opt_opencl_bench(void *optctx, const char *opt, const char *arg) av_log(NULL, AV_LOG_ERROR, "No OpenCL device detected!\n"); return AVERROR(EINVAL); } - if (!(devices = av_malloc(sizeof(OpenCLDeviceBenchmark) * nb_devices))) { + if (!(devices = av_malloc_array(nb_devices, sizeof(OpenCLDeviceBenchmark)))) { av_log(NULL, AV_LOG_ERROR, "Could not allocate buffer\n"); return AVERROR(ENOMEM); }