diff mbox series

[10/15] media: coda: never set infinite timeperframe

Message ID 20181105152513.26345-10-p.zabel@pengutronix.de (mailing list archive)
State New, archived
Headers show
Series [01/15] media: coda: fix memory corruption in case more than 32 instances are opened | expand

Commit Message

Philipp Zabel Nov. 5, 2018, 3:25 p.m. UTC
v4l2-compliance complains if G_PARM returns 0 in the denominator.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
 drivers/media/platform/coda/coda-common.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c
index 32998da39cac..c4d48069606c 100644
--- a/drivers/media/platform/coda/coda-common.c
+++ b/drivers/media/platform/coda/coda-common.c
@@ -1112,10 +1112,10 @@  static void coda_approximate_timeperframe(struct v4l2_fract *timeperframe)
 		return;
 	}
 
-	/* Upper bound is 65536/1, map everything above to infinity */
+	/* Upper bound is 65536/1 */
 	if (s.denominator == 0 || s.numerator / s.denominator > 65536) {
-		timeperframe->numerator = 1;
-		timeperframe->denominator = 0;
+		timeperframe->numerator = 65536;
+		timeperframe->denominator = 1;
 		return;
 	}