Browse Source

[media] coda: fix width validity check when starting to decode

Compare rounded up width to fit into bytesperline.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Markus Pargmann 10 years ago
parent
commit
31db5adb4e
1 changed files with 3 additions and 2 deletions
  1. 3 2
      drivers/media/platform/coda/coda-bit.c

+ 3 - 2
drivers/media/platform/coda/coda-bit.c

@@ -1431,9 +1431,10 @@ static int __coda_start_decoding(struct coda_ctx *ctx)
 		height = val & CODA7_PICHEIGHT_MASK;
 	}
 
-	if (width > q_data_dst->width || height > q_data_dst->height) {
+	if (width > q_data_dst->bytesperline || height > q_data_dst->height) {
 		v4l2_err(&dev->v4l2_dev, "stream is %dx%d, not %dx%d\n",
-			 width, height, q_data_dst->width, q_data_dst->height);
+			 width, height, q_data_dst->bytesperline,
+			 q_data_dst->height);
 		return -EINVAL;
 	}