opencv: Fix memcpy within C++
authorEdward Hervey <edward@centricular.com>
Fri, 11 May 2018 07:54:22 +0000 (09:54 +0200)
committerEdward Hervey <bilboed@bilboed.com>
Fri, 11 May 2018 07:54:22 +0000 (09:54 +0200)
Explicitly cast to void* because GCC 8 is (rightfully) upset that this is
"writing to an object of type ‘...’ with no trivial copy-assignment".

Caused by the new "class-memaccess" warning

ext/opencv/gstgrabcut.cpp

index 4cbc706..2e3aa60 100644 (file)
@@ -315,7 +315,7 @@ gst_grabcut_transform_ip (GstOpencvVideoFilter * filter, GstBuffer * buffer,
     gc->facepos.width = meta->w * gc->scale * 0.9;
     gc->facepos.height = meta->h * gc->scale * 1.1;
   } else {
-    memset (&(gc->facepos), 0, sizeof (gc->facepos));
+    memset (static_cast<void*>(&(gc->facepos)), 0, sizeof (gc->facepos));
   }
 
   /*  normally input should be RGBA */