]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[media] coda: fix width validity check when starting to decode
authorMarkus Pargmann <mpa@pengutronix.de>
Fri, 23 Jan 2015 16:51:25 +0000 (13:51 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Mon, 2 Feb 2015 12:24:57 +0000 (10:24 -0200)
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>
drivers/media/platform/coda/coda-bit.c

index d81635d272de19f5893267364a541322c0d692ed..6ecfd29b7d988158a9b1a8869c09185579019aa5 100644 (file)
@@ -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;
        }