]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/media/video/v4l1-compat.c
Merge branch 'master' into csb1725
[mv-sheeva.git] / drivers / media / video / v4l1-compat.c
index 0c2105ca611e023e3059d2629aa9e43ec02ea3d1..d4ac751036a247c483651d61551ee7517839c4c9 100644 (file)
@@ -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: