[FFmpeg-cvslog] libavutil/opencl: fix potential null dereference

Timo Rothenpieler git at videolan.org
Sun Aug 27 22:09:30 EEST 2017


ffmpeg | branch: master | Timo Rothenpieler <timo at rothenpieler.org> | Sun Jun 11 16:05:45 2017 +0200| [ef0c6d9b01de773e5a1177de5fcbb981aac44d65] | committer: Timo Rothenpieler

libavutil/opencl: fix potential null dereference

Fixes CID 1396840

Reviewed-by: Wei Gao <highgod0401 at gmail.com>
Signed-off-by: Timo Rothenpieler <timo at rothenpieler.org>

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

 libavutil/opencl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavutil/opencl.c b/libavutil/opencl.c
index af35770e06..202756516b 100644
--- a/libavutil/opencl.c
+++ b/libavutil/opencl.c
@@ -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])



More information about the ffmpeg-cvslog mailing list