aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/v4l1-compat.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/v4l1-compat.c')
-rw-r--r--drivers/media/video/v4l1-compat.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/media/video/v4l1-compat.c b/drivers/media/video/v4l1-compat.c
index 0c2105ca611e..d4ac751036a2 100644
--- a/drivers/media/video/v4l1-compat.c
+++ b/drivers/media/video/v4l1-compat.c
@@ -645,9 +645,16 @@ static noinline long v4l1_compat_get_picture(
645 goto done; 645 goto done;
646 } 646 }
647 647
648 pict->depth = ((fmt->fmt.pix.bytesperline << 3) 648 if (fmt->fmt.pix.width)
649 + (fmt->fmt.pix.width - 1)) 649 {
650 / fmt->fmt.pix.width; 650 pict->depth = ((fmt->fmt.pix.bytesperline << 3)
651 + (fmt->fmt.pix.width - 1))
652 / fmt->fmt.pix.width;
653 } else {
654 err = -EINVAL;
655 goto done;
656 }
657
651 pict->palette = pixelformat_to_palette( 658 pict->palette = pixelformat_to_palette(
652 fmt->fmt.pix.pixelformat); 659 fmt->fmt.pix.pixelformat);
653done: 660done: