diff --git a/drivers/media/platform/mxc/capture/mxc_v4l2_capture.c b/drivers/media/platform/mxc/capture/mxc_v4l2_capture.c
index b5b03169bfe19974fd21222dda2bd77d1c701e80..dd9b860e59376ca0674d37c6cd5f59372fb44887 100644
--- a/drivers/media/platform/mxc/capture/mxc_v4l2_capture.c
+++ b/drivers/media/platform/mxc/capture/mxc_v4l2_capture.c
@@ -579,7 +579,7 @@ static int verify_preview(cam_data *cam, struct v4l2_window *win)
 		}
 	} while (++i < FB_MAX);
 
-	if (foregound_fb) {
+	if (foregound_fb && bg_fbi) {
 		width_bound = bg_fbi->var.xres;
 		height_bound = bg_fbi->var.yres;
 
diff --git a/drivers/media/platform/mxc/capture/ov5640_mipi_v2.c b/drivers/media/platform/mxc/capture/ov5640_mipi_v2.c
index 1cb3d69918f463914018c7d38b1ea1617a38097f..45abed4ae349d86c4a56fa1d05da12c464713459 100644
--- a/drivers/media/platform/mxc/capture/ov5640_mipi_v2.c
+++ b/drivers/media/platform/mxc/capture/ov5640_mipi_v2.c
@@ -1376,6 +1376,7 @@ static int ov5640_set_fmt(struct v4l2_subdev *sd,
 	if (!fmt) {
 		mf->code	= ov5640_colour_fmts[0].code;
 		mf->colorspace	= ov5640_colour_fmts[0].colorspace;
+		fmt		= &ov5640_colour_fmts[0];
 	}
 
 	mf->field	= V4L2_FIELD_NONE;