Re: [Gegl-developer] [PATCH 1/1] video-degradation: Don't crash when CL build fails



Please use bugzilla which is GEGLs normal patch/bug handling system.
I've pushed these changes to git master - albeit with slightly
deteriorated meta data since the diffs were manually incorporated.

/pippin

On Sun, May 15, 2016 at 1:04 AM, Jan Vesely <jan vesely rutgers edu> wrote:
Signed-off-by: Jan Vesely <jan vesely rutgers edu>
---
 operations/common/video-degradation.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/operations/common/video-degradation.c b/operations/common/video-degradation.c
index 29197ff..5b84e2a 100644
--- a/operations/common/video-degradation.c
+++ b/operations/common/video-degradation.c
@@ -201,13 +201,17 @@ cl_process (GeglOperation       *operation,
   const size_t gbl_size[2] = {roi->width, roi->height};
   const size_t gbl_off[2]  = {roi->x, roi->y};
   cl_int cl_err = 0;
+  cl_mem filter_pat = NULL;

-  cl_mem filter_pat = gegl_clCreateBuffer (gegl_cl_get_context (),
-                                           CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR,
-                                           pattern_width[o->pattern] *
-                                           pattern_height[o->pattern] * sizeof(cl_int),
-                                           (void*)pattern[o->pattern],
-                                           &cl_err);
+  if (!cl_data)
+    goto error;
+
+  filter_pat = gegl_clCreateBuffer (gegl_cl_get_context (),
+                                    CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR,
+                                    pattern_width[o->pattern] *
+                                    pattern_height[o->pattern] * sizeof(cl_int),
+                                    (void*)pattern[o->pattern],
+                                    &cl_err);
   CL_CHECK;
   cl_err = gegl_cl_set_kernel_args (cl_data->kernel[0],
                                     sizeof(cl_mem), &in_buf,
--
2.5.5

_______________________________________________
gegl-developer-list mailing list
List address:    gegl-developer-list gnome org
List membership: https://mail.gnome.org/mailman/listinfo/gegl-developer-list



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]