v4l2-compliance: add bytesperline sanity check for multiplanar formats.
authorHans Verkuil <hans.verkuil@cisco.com>
Tue, 11 Feb 2014 07:24:17 +0000 (08:24 +0100)
committerHans Verkuil <hans.verkuil@cisco.com>
Tue, 11 Feb 2014 07:26:04 +0000 (08:26 +0100)
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
utils/v4l2-compliance/v4l2-test-formats.cpp

index 9ae2df3..db023f3 100644 (file)
@@ -379,6 +379,7 @@ static int testFormatsType(struct node *node, int ret,  unsigned type, struct v4
        unsigned min_sampling_rate;
        v4l2_std_id std;
        __u32 service_set = 0;
+       unsigned tot_bytesperline = 0;
        unsigned cnt = 0;
 
        if (ret == ENOTTY)
@@ -424,8 +425,9 @@ static int testFormatsType(struct node *node, int ret,  unsigned type, struct v4
                        if (ret)
                                return fail("pix_mp.plane_fmt[%d].reserved not zeroed\n", i);
                        fail_on_test(!pfmt.sizeimage);
-                       fail_on_test(pfmt.bytesperline && pfmt.bytesperline < pix_mp.width);
+                       tot_bytesperline += pfmt.bytesperline;
                }
+               fail_on_test(tot_bytesperline && tot_bytesperline < pix_mp.width);
                break;
        case V4L2_BUF_TYPE_VBI_CAPTURE:
        case V4L2_BUF_TYPE_VBI_OUTPUT: