From 32d2bd56a038929e836cbdf9b5cd85b942d14b07 Mon Sep 17 00:00:00 2001 From: "Dr. David Alan Gilbert" Date: Sun, 24 Oct 2010 13:33:09 -0300 Subject: [PATCH] --- yaml --- r: 219537 b: refs/heads/master c: 910f5f05f99c1ffbb484c4e6eb2a460e7a08e2d7 h: refs/heads/master i: 219535: 71ffa8202dbef5befb954db04a592c5121238712 v: v3 --- [refs] | 2 +- trunk/drivers/media/video/v4l1-compat.c | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 060b1a400bdd..3ac055f6885d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 52fae5eead706cb8d604ee634162f6694d75ccad +refs/heads/master: 910f5f05f99c1ffbb484c4e6eb2a460e7a08e2d7 diff --git a/trunk/drivers/media/video/v4l1-compat.c b/trunk/drivers/media/video/v4l1-compat.c index 0c2105ca611e..d4ac751036a2 100644 --- a/trunk/drivers/media/video/v4l1-compat.c +++ b/trunk/drivers/media/video/v4l1-compat.c @@ -645,9 +645,16 @@ static noinline long v4l1_compat_get_picture( goto done; } - pict->depth = ((fmt->fmt.pix.bytesperline << 3) - + (fmt->fmt.pix.width - 1)) - / fmt->fmt.pix.width; + if (fmt->fmt.pix.width) + { + pict->depth = ((fmt->fmt.pix.bytesperline << 3) + + (fmt->fmt.pix.width - 1)) + / fmt->fmt.pix.width; + } else { + err = -EINVAL; + goto done; + } + pict->palette = pixelformat_to_palette( fmt->fmt.pix.pixelformat); done: