[FFmpeg-devel] lavfi/avgblur_opencl: fix using uninitialized value

Submitted by Danil Iashchenko on July 9, 2018, 12:41 p.m.

Details

Message ID 1531140108-24729-1-git-send-email-danyaschenko@gmail.com
State Accepted
Commit 2bdb6b64969f3d068cf0ec1a3f95eabbe9fd90d1
Headers show

Commit Message

Danil Iashchenko July 9, 2018, 12:41 p.m.
Fixed using uninitialized value "global_work[0]" when calling "av_log".

---
 libavfilter/vf_avgblur_opencl.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Mark Thompson July 11, 2018, 10:18 p.m.
On 09/07/18 13:41, Danil Iashchenko wrote:
> Fixed using uninitialized value "global_work[0]" when calling "av_log".
> 
> ---
>  libavfilter/vf_avgblur_opencl.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/libavfilter/vf_avgblur_opencl.c b/libavfilter/vf_avgblur_opencl.c
> index d1d3eb1..772b14e 100644
> --- a/libavfilter/vf_avgblur_opencl.c
> +++ b/libavfilter/vf_avgblur_opencl.c
> @@ -215,10 +215,6 @@ static int avgblur_opencl_filter_frame(AVFilterLink *inlink, AVFrame *input)
>              radius_y = 0;
>          }
>  
> -        av_log(avctx, AV_LOG_DEBUG, "Run kernel on plane %d "
> -               "(%"SIZE_SPECIFIER"x%"SIZE_SPECIFIER").\n",
> -               p, global_work[0], global_work[1]);
> -
>          for (i = 0; i < ctx->power[p]; i++) {
>              CL_SET_KERNEL_ARG(ctx->kernel_horiz, 0, cl_mem, &inter);
>              CL_SET_KERNEL_ARG(ctx->kernel_horiz, 1, cl_mem, i == 0 ? &src : &dst);
> @@ -233,6 +229,10 @@ static int avgblur_opencl_filter_frame(AVFilterLink *inlink, AVFrame *input)
>              if (err < 0)
>                  goto fail;
>  
> +            av_log(avctx, AV_LOG_DEBUG, "Run kernel on plane %d "
> +                   "(%"SIZE_SPECIFIER"x%"SIZE_SPECIFIER").\n",
> +                   p, global_work[0], global_work[1]);
> +
>              cle = clEnqueueNDRangeKernel(ctx->command_queue, ctx->kernel_horiz, 2, NULL,
>                                           global_work, NULL,
>                                           0, NULL, NULL);
> 

LGTM.  Added note for CID #1437471 and applied.

Thanks,

- Mark

Patch hide | download patch | download mbox

diff --git a/libavfilter/vf_avgblur_opencl.c b/libavfilter/vf_avgblur_opencl.c
index d1d3eb1..772b14e 100644
--- a/libavfilter/vf_avgblur_opencl.c
+++ b/libavfilter/vf_avgblur_opencl.c
@@ -215,10 +215,6 @@  static int avgblur_opencl_filter_frame(AVFilterLink *inlink, AVFrame *input)
             radius_y = 0;
         }
 
-        av_log(avctx, AV_LOG_DEBUG, "Run kernel on plane %d "
-               "(%"SIZE_SPECIFIER"x%"SIZE_SPECIFIER").\n",
-               p, global_work[0], global_work[1]);
-
         for (i = 0; i < ctx->power[p]; i++) {
             CL_SET_KERNEL_ARG(ctx->kernel_horiz, 0, cl_mem, &inter);
             CL_SET_KERNEL_ARG(ctx->kernel_horiz, 1, cl_mem, i == 0 ? &src : &dst);
@@ -233,6 +229,10 @@  static int avgblur_opencl_filter_frame(AVFilterLink *inlink, AVFrame *input)
             if (err < 0)
                 goto fail;
 
+            av_log(avctx, AV_LOG_DEBUG, "Run kernel on plane %d "
+                   "(%"SIZE_SPECIFIER"x%"SIZE_SPECIFIER").\n",
+                   p, global_work[0], global_work[1]);
+
             cle = clEnqueueNDRangeKernel(ctx->command_queue, ctx->kernel_horiz, 2, NULL,
                                          global_work, NULL,
                                          0, NULL, NULL);