This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/cgit.cgi/v4l-utils.git tree:

Subject: v4l2-ctl: zero v4l2_fmtdesc
Author:  Hans Verkuil <[email protected]>
Date:    Wed May 6 17:55:40 2020 +0200

In several places struct v4l2_fmtdesc was not properly zeroed.
Fix this.

This missing initialization caused vimc to fail since the new
mbus_code field was uninitialized.

Signed-off-by: Hans Verkuil <[email protected]>

 utils/v4l2-ctl/v4l2-ctl-meta.cpp      |  2 +-
 utils/v4l2-ctl/v4l2-ctl-sdr.cpp       |  4 ++--
 utils/v4l2-ctl/v4l2-ctl-streaming.cpp |  2 +-
 utils/v4l2-ctl/v4l2-ctl.cpp           | 11 +++++------
 4 files changed, 9 insertions(+), 10 deletions(-)

---

http://git.linuxtv.org/cgit.cgi/v4l-utils.git/commit/?id=e0de0ec4541424a59891038be2a61de9231ad701
diff --git a/utils/v4l2-ctl/v4l2-ctl-meta.cpp b/utils/v4l2-ctl/v4l2-ctl-meta.cpp
index 2561b0291f01..3e71a6eb6f3c 100644
--- a/utils/v4l2-ctl/v4l2-ctl-meta.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-meta.cpp
@@ -73,7 +73,7 @@ static void __meta_set(cv4l_fd &_fd, bool set, bool _try, 
__u32 type)
        in_vfmt.fmt.meta.dataformat = vfmt.fmt.meta.dataformat;
 
        if (in_vfmt.fmt.meta.dataformat < 256) {
-               struct v4l2_fmtdesc fmt;
+               struct v4l2_fmtdesc fmt = {};
 
                fmt.index = in_vfmt.fmt.meta.dataformat;
                fmt.type = in_vfmt.type;
diff --git a/utils/v4l2-ctl/v4l2-ctl-sdr.cpp b/utils/v4l2-ctl/v4l2-ctl-sdr.cpp
index 62b26f0cf252..71a6591326c3 100644
--- a/utils/v4l2-ctl/v4l2-ctl-sdr.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-sdr.cpp
@@ -75,7 +75,7 @@ void sdr_set(cv4l_fd &_fd)
                in_vfmt.fmt.sdr.pixelformat = vfmt.fmt.sdr.pixelformat;
 
                if (in_vfmt.fmt.sdr.pixelformat < 256) {
-                       struct v4l2_fmtdesc fmt;
+                       struct v4l2_fmtdesc fmt = {};
 
                        fmt.index = in_vfmt.fmt.sdr.pixelformat;
                        fmt.type = V4L2_BUF_TYPE_SDR_CAPTURE;
@@ -100,7 +100,7 @@ void sdr_set(cv4l_fd &_fd)
                in_vfmt.fmt.sdr.pixelformat = vfmt.fmt.sdr.pixelformat;
 
                if (in_vfmt.fmt.sdr.pixelformat < 256) {
-                       struct v4l2_fmtdesc fmt;
+                       struct v4l2_fmtdesc fmt = {};
 
                        fmt.index = in_vfmt.fmt.sdr.pixelformat;
                        fmt.type = V4L2_BUF_TYPE_SDR_OUTPUT;
diff --git a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp 
b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
index 95ffe986eaef..0d5a1e1a5501 100644
--- a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
@@ -366,7 +366,7 @@ void streaming_usage()
 static enum codec_type get_codec_type(cv4l_fd &fd)
 {
        cv4l_disable_trace dt(fd);
-       struct v4l2_fmtdesc fmt_desc;
+       struct v4l2_fmtdesc fmt_desc = {};
        int num_cap_fmts = 0;
        int num_compressed_cap_fmts = 0;
        int num_out_fmts = 0;
diff --git a/utils/v4l2-ctl/v4l2-ctl.cpp b/utils/v4l2-ctl/v4l2-ctl.cpp
index f8187fea9ece..e7b270cd8352 100644
--- a/utils/v4l2-ctl/v4l2-ctl.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl.cpp
@@ -389,7 +389,7 @@ static bool is_rgb_or_hsv(__u32 pixelformat)
 
 static std::string printfmtname(int fd, __u32 type, __u32 pixfmt)
 {
-       struct v4l2_fmtdesc fmt;
+       struct v4l2_fmtdesc fmt = {};
        std::string s(" (");
 
        fmt.index = 0;
@@ -607,7 +607,7 @@ void print_frmival(const struct v4l2_frmivalenum &frmival, 
const char *prefix)
 void print_video_formats(cv4l_fd &fd, __u32 type)
 {
        cv4l_disable_trace dt(fd);
-       struct v4l2_fmtdesc fmt;
+       struct v4l2_fmtdesc fmt = {};
 
        printf("\tType: %s\n\n", buftype2s(type).c_str());
        if (fd.enum_fmt(fmt, true, 0, type))
@@ -624,7 +624,7 @@ void print_video_formats(cv4l_fd &fd, __u32 type)
 void print_video_formats_ext(cv4l_fd &fd, __u32 type)
 {
        cv4l_disable_trace dt(fd);
-       struct v4l2_fmtdesc fmt;
+       struct v4l2_fmtdesc fmt = {};
        struct v4l2_frmsizeenum frmsize;
        struct v4l2_frmivalenum frmival;
 
@@ -961,9 +961,8 @@ static __u32 parse_event(const char *e, const char **name)
 
 bool valid_pixel_format(int fd, __u32 pixelformat, bool output, bool mplane)
 {
-       struct v4l2_fmtdesc fmt;
+       struct v4l2_fmtdesc fmt = {};
 
-       fmt.index = 0;
        if (output)
                fmt.type = mplane ? V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE :
                        V4L2_BUF_TYPE_VIDEO_OUTPUT;
@@ -981,7 +980,7 @@ bool valid_pixel_format(int fd, __u32 pixelformat, bool 
output, bool mplane)
 
 __u32 find_pixel_format(int fd, unsigned index, bool output, bool mplane)
 {
-       struct v4l2_fmtdesc fmt;
+       struct v4l2_fmtdesc fmt = {};
 
        fmt.index = index;
        if (output)

_______________________________________________
linuxtv-commits mailing list
[email protected]
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to