You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, i'm trying to add custom meta data into a buffer and have a problem calling RegisterAPIType .
When I do something like
t := gst.RegisterAPIType("NewObjectType", []string{"sometag"} )
the calling program crashes (no stack).
I think gcharStrings has a few major problems
func gcharStrings(strs []string) **C.gchar {
gcharSlc := make([]*C.gchar, len(strs)) // <- shouldn't it be alloced by the c allocator ? also, it won't be nil terminated
for _, s := range strs {
cStr := C.CString(s)
defer C.free(unsafe.Pointer(cStr)) // <- this will cause the pointed array of char to be freed before we even use the array
gcharSlc = append(gcharSlc, cStr)
}
return &gcharSlc[0]
}
this gcharStrings() function is also called by FilterProtectionSystemByDecryptors() and SelectProtectionSystem()
I am also confused by the fact that the caller calls C.free on the returned object which is &gcharSlc[0]..
The text was updated successfully, but these errors were encountered:
Hello, i'm trying to add custom meta data into a buffer and have a problem calling RegisterAPIType .
When I do something like
t := gst.RegisterAPIType("NewObjectType", []string{"sometag"} )
the calling program crashes (no stack).
I think gcharStrings has a few major problems
this gcharStrings() function is also called by FilterProtectionSystemByDecryptors() and SelectProtectionSystem()
I am also confused by the fact that the caller calls C.free on the returned object which is &gcharSlc[0]..
The text was updated successfully, but these errors were encountered: