libavutil/opencl: fix potential null dereference
authorTimo Rothenpieler <timo@rothenpieler.org>
Sun, 11 Jun 2017 14:05:45 +0000 (16:05 +0200)
committerTimo Rothenpieler <timo@rothenpieler.org>
Sun, 27 Aug 2017 19:08:17 +0000 (21:08 +0200)
Fixes CID 1396840

Reviewed-by: Wei Gao <highgod0401@gmail.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
libavutil/opencl.c

index af35770..2027565 100644 (file)
@@ -169,7 +169,7 @@ const char *av_opencl_errstr(cl_int status)
 static void free_device_list(AVOpenCLDeviceList *device_list)
 {
     int i, j;
-    if (!device_list)
+    if (!device_list || !device_list->platform_node)
         return;
     for (i = 0; i < device_list->platform_num; i++) {
         if (!device_list->platform_node[i])