mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-13 10:55:34 +00:00
miniobject: don't modify memory if it's clearly not a valid miniobject
Add back function guard that checks the refcount in a read-only operation first, and bail out without modifying the passed-in memory if it's clearly not a valid mini object. Otherwise we probably cause more harm than good. We keep the second sanity check based on the 'real refcount' at the time of the unref around for now too. https://bugzilla.gnome.org/show_bug.cgi?id=784383
This commit is contained in:
parent
b37429c995
commit
ea62c96b94
1 changed files with 1 additions and 0 deletions
|
@ -429,6 +429,7 @@ gst_mini_object_unref (GstMiniObject * mini_object)
|
|||
gint old_refcount, new_refcount;
|
||||
|
||||
g_return_if_fail (mini_object != NULL);
|
||||
g_return_if_fail (GST_MINI_OBJECT_REFCOUNT_VALUE (mini_object) > 0);
|
||||
|
||||
old_refcount = g_atomic_int_add (&mini_object->refcount, -1);
|
||||
new_refcount = old_refcount - 1;
|
||||
|
|
Loading…
Reference in a new issue