[FFmpeg-cvslog] cmdutils_opencl: Use av_malloc_array()

Michael Niedermayer git at videolan.org
Tue Jul 1 04:42:28 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Jul  1 03:49:36 2014 +0200| [80da227c660e7bef7400f602a9817a897f07022b] | committer: Michael Niedermayer

cmdutils_opencl: Use av_malloc_array()

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=80da227c660e7bef7400f602a9817a897f07022b
---

 cmdutils_opencl.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmdutils_opencl.c b/cmdutils_opencl.c
index 0fa8cc0..3dfd156 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);
     }



More information about the ffmpeg-cvslog mailing list