media: rockchip: vicap fixed error of get_selection

when result of --get-compose is success, but width/height equal 0,
may cause v4l2-ctl unable to save image

Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: Ibe572b53da346aef233a15c70c6050ad2207a21d
This commit is contained in:
Zefa Chen
2022-09-16 12:26:39 +08:00
committed by 陈泽发
parent 4e4348fed0
commit 720983a82c

View File

@@ -5770,9 +5770,7 @@ static int rkcif_g_selection(struct file *file, void *fh,
s->r.width = stream->pixm.width;
s->r.height = stream->pixm.height;
}
}
if (s->target == V4L2_SEL_TGT_CROP) {
} else if (s->target == V4L2_SEL_TGT_CROP) {
if (stream->crop_mask & (CROP_SRC_USR_MASK | CROP_SRC_SENSOR_MASK)) {
s->r = stream->crop[CROP_SRC_ACT];
} else {
@@ -5781,6 +5779,8 @@ static int rkcif_g_selection(struct file *file, void *fh,
s->r.width = stream->pixm.width;
s->r.height = stream->pixm.height;
}
} else {
goto err;
}
return ret;