Skip to content
Snippets Groups Projects
Commit eb21da59 authored by Kipp Cannon's avatar Kipp Cannon
Browse files

framecpp_channeldemux: lock during library name update

- acquire the element lock when updating the frame-library-name property
- prevents possible access-after-free race condition if value is accessed during the window between the free of the old pointer and the assignment of the new pointer
parent ae2d08cd
No related branches found
No related tags found
No related merge requests found
......@@ -891,8 +891,10 @@ static GstFlowReturn chain(GstPad *pad, GstObject *parent, GstBuffer *inbuf)
g_object_notify(G_OBJECT(element), "frame-library-version");
}
if(g_strcmp0(ifs.FrameLibraryName().c_str(), element->frame_library_name)) {
GST_OBJECT_LOCK(element);
g_free(element->frame_library_name);
element->frame_library_name = g_strdup(ifs.FrameLibraryName().c_str());
GST_OBJECT_UNLOCK(element);
g_object_notify(G_OBJECT(element), "frame-library-name");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment