mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-05 15:08:48 +00:00
glcontext/egl: Fix use of uninitialized memory
At least some Mesa drivers (see llvmpipe_query_dmabuf_modifiers()) don't initialize the provided external_only array, so some format/modifier combinations could get incorrectly marked as only external. Make sure we zerofill the array before passing it to eglQueryDmaBufModifiersEXT(). Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6792>
This commit is contained in:
parent
5b55930db8
commit
1ef9f6ab26
1 changed files with 2 additions and 1 deletions
|
@ -1733,11 +1733,12 @@ gst_gl_context_egl_fetch_dma_formats (GstGLContext * context)
|
|||
|
||||
if (mods_len == 0) {
|
||||
modifiers = g_new (EGLuint64KHR, num_mods);
|
||||
ext_only = g_new (EGLBoolean, num_mods);
|
||||
ext_only = g_new0 (EGLBoolean, num_mods);
|
||||
mods_len = num_mods;
|
||||
} else if (mods_len < num_mods) {
|
||||
modifiers = g_renew (EGLuint64KHR, modifiers, num_mods);
|
||||
ext_only = g_renew (EGLBoolean, ext_only, num_mods);
|
||||
memset (ext_only, 0, num_mods * sizeof (EGLBoolean));
|
||||
mods_len = num_mods;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue