diff mbox

[FFmpeg-devel,03/11] libavutil/opencl: fix potentiall nul dereference

Message ID 20170611140551.11844-3-timo@rothenpieler.org
State Accepted
Commit ef0c6d9b01de773e5a1177de5fcbb981aac44d65
Headers show

Commit Message

Timo Rothenpieler June 11, 2017, 2:05 p.m. UTC
Fixes CID 1396840
---
 libavutil/opencl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Wei Gao Aug. 14, 2017, 1:47 a.m. UTC | #1
2017-06-11 22:05 GMT+08:00 Timo Rothenpieler <timo@rothenpieler.org>:

> Fixes CID 1396840
> ---
>  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])
> --
> 2.13.0
>
Looks good to me, thanks.

>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
Timo Rothenpieler Aug. 27, 2017, 7:10 p.m. UTC | #2
Am 14.08.2017 um 03:47 schrieb Wei Gao:
> 2017-06-11 22:05 GMT+08:00 Timo Rothenpieler <timo@rothenpieler.org>:
> 
>> Fixes CID 1396840
>> ---
>>   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])
>> --
>> 2.13.0
>>
> Looks good to me, thanks.
> 

applied
diff mbox

Patch

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])