cmdutils_opencl: Use av_malloc_array()
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 1 Jul 2014 01:49:36 +0000 (03:49 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 1 Jul 2014 01:49:36 +0000 (03:49 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
cmdutils_opencl.c

index 0fa8cc0..3dfd156 100644 (file)
@@ -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);
     }