mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
glshader: don't read invalid list pointers (use after free)
gst_gl_shader_detach_unlocked already removes the list entry so attempting to use the element to iterate to the next stage could read invalid data. Based on patch by Vineeth TM <vineeth.tm@samsung.com> https://bugzilla.gnome.org/show_bug.cgi?id=758039
This commit is contained in:
parent
e940d8875d
commit
babd066b89
1 changed files with 3 additions and 1 deletions
|
@ -668,10 +668,12 @@ gst_gl_shader_release_unlocked (GstGLShader * shader)
|
||||||
|
|
||||||
priv = shader->priv;
|
priv = shader->priv;
|
||||||
|
|
||||||
for (elem = shader->priv->stages; elem; elem = elem->next) {
|
for (elem = shader->priv->stages; elem;) {
|
||||||
GstGLSLStage *stage = elem->data;
|
GstGLSLStage *stage = elem->data;
|
||||||
|
GList *next = elem->next;
|
||||||
|
|
||||||
gst_gl_shader_detach_unlocked (shader, stage);
|
gst_gl_shader_detach_unlocked (shader, stage);
|
||||||
|
elem = next;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_list_free_full (shader->priv->stages, (GDestroyNotify) gst_object_unref);
|
g_list_free_full (shader->priv->stages, (GDestroyNotify) gst_object_unref);
|
||||||
|
|
Loading…
Reference in a new issue