The try_fmt() handler restricts the image width based on the hardware
limits and updates the bytesperline value, but doesn't update sizeimage.
Fix it.

Signed-off-by: Laurent Pinchart <laurent.pinch...@ideasonboard.com>
---
 drivers/media/video/mx2_camera.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c
index 04aab0c..77f8dde 100644
--- a/drivers/media/video/mx2_camera.c
+++ b/drivers/media/video/mx2_camera.c
@@ -1142,6 +1142,7 @@ static int mx2_camera_try_fmt(struct soc_camera_device 
*icd,
                        pix->bytesperline = soc_mbus_bytes_per_line(pix->width,
                                                        xlate->host_fmt);
                        BUG_ON(pix->bytesperline < 0);
+                       pix->sizeimage = pix->height * pix->bytesperline;
                }
        }
 
-- 
1.7.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to