From: Hans Verkuil Date: Tue, 18 Feb 2014 08:05:37 +0000 (+0100) Subject: v4l2-compliance: fix data_offset related tests X-Git-Tag: v4l-utils-1.2.0~202 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bee9cc6db288de90831e9a0b00f9eab5d51adf79;p=platform%2Fupstream%2Fv4l-utils.git v4l2-compliance: fix data_offset related tests While testing the handling of data_offset I found some incorrect checks. Fixed those. Also removed some duplicate checks. Signed-off-by: Hans Verkuil --- diff --git a/utils/v4l2-compliance/v4l2-test-buffers.cpp b/utils/v4l2-compliance/v4l2-test-buffers.cpp index c00e9f0..5b524c7 100644 --- a/utils/v4l2-compliance/v4l2-test-buffers.cpp +++ b/utils/v4l2-compliance/v4l2-test-buffers.cpp @@ -147,7 +147,6 @@ static int checkQueryBuf(struct node *node, const struct v4l2_buffer &buf, if (mode == Dequeued || mode == Prepared) { if (V4L2_TYPE_IS_MULTIPLANAR(type)) { - fail_on_test(buf.length > VIDEO_MAX_PLANES); for (unsigned p = 0; p < buf.length; p++) { struct v4l2_plane *vp = buf.m.planes + p; @@ -155,7 +154,6 @@ static int checkQueryBuf(struct node *node, const struct v4l2_buffer &buf, fail_on_test((void *)vp->m.userptr != ptrs[buf.index][p]); else if (buf.memory == V4L2_MEMORY_DMABUF) fail_on_test(vp->m.fd != dmabufs[buf.index][p]); - fail_on_test(vp->data_offset + vp->bytesused > vp->length); } } else { if (buf.memory == V4L2_MEMORY_USERPTR) @@ -167,11 +165,11 @@ static int checkQueryBuf(struct node *node, const struct v4l2_buffer &buf, if (mode == Dequeued) { if (V4L2_TYPE_IS_MULTIPLANAR(type)) { - fail_on_test(buf.length > VIDEO_MAX_PLANES); for (unsigned p = 0; p < buf.length; p++) { struct v4l2_plane *vp = buf.m.planes + p; fail_on_test(!vp->bytesused); + fail_on_test(vp->data_offset >= vp->bytesused); fail_on_test(vp->bytesused > vp->length); } } else {