gst/gstbuffer.c: Implement poisoning for GstBuffer if --enable-poisoning is specified.

Original commit message from CVS:
* gst/gstbuffer.c: (gst_buffer_finalize):
Implement poisoning for GstBuffer if --enable-poisoning is specified.
When finalizing a buffer the complete struct is filled with 0xff,
thus making a use of the buffer after the final unref impossible.
This commit is contained in:
Sebastian Dröge 2007-09-13 08:42:55 +00:00
parent b598394d3b
commit 93634c30c2
2 changed files with 11 additions and 0 deletions

View file

@ -1,3 +1,10 @@
2007-09-13 Sebastian Dröge <slomo@circular-chaos.org>
* gst/gstbuffer.c: (gst_buffer_finalize):
Implement poisoning for GstBuffer if --enable-poisoning is specified.
When finalizing a buffer the complete struct is filled with 0xff,
thus making a use of the buffer after the final unref impossible.
2007-09-13 Sebastian Dröge <slomo@circular-chaos.org> 2007-09-13 Sebastian Dröge <slomo@circular-chaos.org>
* tests/check/libs/controller.c: (GST_START_TEST): * tests/check/libs/controller.c: (GST_START_TEST):

View file

@ -192,6 +192,10 @@ gst_buffer_finalize (GstBuffer * buffer)
g_free (buffer->malloc_data); g_free (buffer->malloc_data);
gst_caps_replace (&GST_BUFFER_CAPS (buffer), NULL); gst_caps_replace (&GST_BUFFER_CAPS (buffer), NULL);
#ifdef USE_POISONING
memset (buffer, 0xff, sizeof (GstBuffer));
#endif
} }
/** /**