summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2017-06-22 14:05:24 -0500
committerDerek Foreman <derekf@osg.samsung.com>2017-06-22 14:05:24 -0500
commite6f17dee5d6ae504b4565afc7e5f9033cd597e22 (patch)
tree5e82ff937ce2c9d588a09235e29efccf21a5de1d
parent62feb358e6a9d4307bdeb72234a87bf0e3d8ccc1 (diff)
Clear the native surface structure before initializing it
Since the native surface "API" is isomorphic with pain and suffering, we should be extra careful when we touch it.
-rw-r--r--src/bin/e_pixmap.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/bin/e_pixmap.c b/src/bin/e_pixmap.c
index 29f8529b2..0ddd646b9 100644
--- a/src/bin/e_pixmap.c
+++ b/src/bin/e_pixmap.c
@@ -703,6 +703,17 @@ e_pixmap_native_surface_init(E_Pixmap *cp, Evas_Native_Surface *ns)
703 EINA_SAFETY_ON_NULL_RETURN_VAL(cp, EINA_FALSE); 703 EINA_SAFETY_ON_NULL_RETURN_VAL(cp, EINA_FALSE);
704 EINA_SAFETY_ON_NULL_RETURN_VAL(ns, EINA_FALSE); 704 EINA_SAFETY_ON_NULL_RETURN_VAL(ns, EINA_FALSE);
705 705
706 /* This structure is stack automatic in the caller, so it's all
707 * uninitialized. Clear it to 0 so we don't have uninit data for
708 * variables only present in a newer version of native surface
709 * than this code was written for.
710 *
711 * The other option would be to set ns->version to whatever version
712 * this code was actually written against, but I've been told all
713 * native surface users are expected to set ns->version to the
714 * version provided in the headers (EVAS_NATIVE_SURFACE_VERSION)
715 */
716 memset(ns, 0, sizeof(*ns));
706 ns->version = EVAS_NATIVE_SURFACE_VERSION; 717 ns->version = EVAS_NATIVE_SURFACE_VERSION;
707 switch (cp->type) 718 switch (cp->type)
708 { 719 {