mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-19 22:05:58 +00:00
fuzzing: Fix leak due to wrong initialization
We were registering plugins again and again and again ...
This commit is contained in:
parent
39ce1f76a4
commit
8f4bcce46e
2 changed files with 6 additions and 2 deletions
|
@ -88,7 +88,7 @@ int LLVMFuzzerTestOneInput(const guint8 *data, size_t size)
|
|||
GstDiscoverer *dc;
|
||||
gint timeout = 10;
|
||||
GstDiscovererInfo *info;
|
||||
static gboolean initialized = 0;
|
||||
static gboolean initialized = FALSE;
|
||||
|
||||
if (!initialized) {
|
||||
/* We want critical warnings to assert so we can fix them */
|
||||
|
@ -105,6 +105,8 @@ int LLVMFuzzerTestOneInput(const guint8 *data, size_t size)
|
|||
GST_PLUGIN_STATIC_REGISTER(ogg);
|
||||
GST_PLUGIN_STATIC_REGISTER(theora);
|
||||
GST_PLUGIN_STATIC_REGISTER(vorbis);
|
||||
|
||||
initialized = TRUE;
|
||||
}
|
||||
|
||||
dc = gst_discoverer_new (timeout * GST_SECOND, &err);
|
||||
|
|
|
@ -59,7 +59,7 @@ int
|
|||
LLVMFuzzerTestOneInput (const guint8 * data, size_t size)
|
||||
{
|
||||
GError *err = NULL;
|
||||
static gboolean initialized = 0;
|
||||
static gboolean initialized = FALSE;
|
||||
GstElement *pipeline, *source, *typefind, *fakesink;
|
||||
GstBuffer *buf;
|
||||
GstFlowReturn flowret;
|
||||
|
@ -76,6 +76,8 @@ LLVMFuzzerTestOneInput (const guint8 * data, size_t size)
|
|||
GST_PLUGIN_STATIC_REGISTER (coreelements);
|
||||
GST_PLUGIN_STATIC_REGISTER (typefindfunctions);
|
||||
GST_PLUGIN_STATIC_REGISTER (app);
|
||||
|
||||
initialized = TRUE;
|
||||
}
|
||||
|
||||
/* Create the pipeline */
|
||||
|
|
Loading…
Reference in a new issue