avutil/opencl: fix a segmentfault in libavutil/opencl.c
authorY.C. Liu <liuycsd@gmail.com>
Tue, 22 Apr 2014 14:24:22 +0000 (22:24 +0800)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 25 Apr 2014 03:29:21 +0000 (05:29 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavutil/opencl.c

index 142c6b0..f67eb5e 100644 (file)
@@ -169,7 +169,7 @@ static const OpenclErrorMsg opencl_err_msg[] = {
 const char *av_opencl_errstr(cl_int status)
 {
     int i;
-    for (i = 0; i < sizeof(opencl_err_msg); i++) {
+    for (i = 0; i < FF_ARRAY_ELEMS(opencl_err_msg); i++) {
         if (opencl_err_msg[i].err_code == status)
             return opencl_err_msg[i].err_str;
     }