From 72fdea5c13e15d27078309140836a468e1eacbb4 Mon Sep 17 00:00:00 2001 From: pengyiqiang Date: Mon, 19 Dec 2022 17:55:02 +0800 Subject: [PATCH] video/fb: initializes the info structure Signed-off-by: pengyiqiang --- drivers/video/fb.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/video/fb.c b/drivers/video/fb.c index 2b45141fb8..bc7fd7b5bc 100644 --- a/drivers/video/fb.c +++ b/drivers/video/fb.c @@ -388,6 +388,7 @@ static int fb_ioctl(FAR struct file *filep, int cmd, unsigned long arg) DEBUGASSERT(fb->vtable != NULL && fb->vtable->getoverlayinfo != NULL); + memset(&oinfo, 0, sizeof(oinfo)); ret = fb->vtable->getoverlayinfo(fb->vtable, arg, &oinfo); if (ret == OK) { @@ -555,6 +556,7 @@ static int fb_ioctl(FAR struct file *filep, int cmd, unsigned long arg) break; } + memset(&pinfo, 0, sizeof(pinfo)); ret = fb->vtable->getplaneinfo(fb->vtable, fb->plane, &pinfo); if (ret < 0) { @@ -648,6 +650,7 @@ static int fb_ioctl(FAR struct file *filep, int cmd, unsigned long arg) break; } + memset(&pinfo, 0, sizeof(pinfo)); ret = fb->vtable->getplaneinfo(fb->vtable, fb->plane, &pinfo); if (ret < 0) { @@ -826,6 +829,7 @@ int fb_register(int display, int plane) DEBUGASSERT(vinfo.nplanes > 0 && (unsigned)plane < vinfo.nplanes); DEBUGASSERT(fb->vtable->getplaneinfo != NULL); + memset(&pinfo, 0, sizeof(pinfo)); ret = fb->vtable->getplaneinfo(fb->vtable, plane, &pinfo); if (ret < 0) { @@ -845,6 +849,7 @@ int fb_register(int display, int plane) /* Initialize first overlay but do not select */ DEBUGASSERT(fb->vtable->getoverlayinfo != NULL); + memset(&oinfo, 0, sizeof(oinfo)); ret = fb->vtable->getoverlayinfo(fb->vtable, 0, &oinfo); if (ret < 0) {