Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a1d898af authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: vidc: Do sanity check for different IOCTL cmd"

parents cd089cd5 d40320b6
Loading
Loading
Loading
Loading
+15 −6
Original line number Diff line number Diff line
@@ -733,6 +733,13 @@ int msm_vidc_prepare_buf(void *instance, struct v4l2_buffer *b)
	if (!inst || !b)
		return -EINVAL;

	if (!V4L2_TYPE_IS_MULTIPLANAR(b->type) || !b->length ||
		(b->length > VIDEO_MAX_PLANES)) {
		dprintk(VIDC_ERR, "%s: wrong input params\n",
				__func__);
		return -EINVAL;
	}

	if (is_dynamic_output_buffer_mode(b, inst)) {
		dprintk(VIDC_ERR, "%s: not supported in dynamic buffer mode\n",
				__func__);
@@ -885,9 +892,10 @@ int msm_vidc_qbuf(void *instance, struct v4l2_buffer *b)
	if (!inst || !b)
		return -EINVAL;

	if (b->length > VIDEO_MAX_PLANES) {
		dprintk(VIDC_ERR, "num planes exceeds max: %d\n",
			b->length);
	if (!V4L2_TYPE_IS_MULTIPLANAR(b->type) || !b->length ||
		(b->length > VIDEO_MAX_PLANES)) {
		dprintk(VIDC_ERR, "%s: wrong input params\n",
				__func__);
		return -EINVAL;
	}

@@ -968,9 +976,10 @@ int msm_vidc_dqbuf(void *instance, struct v4l2_buffer *b)
	if (!inst || !b)
		return -EINVAL;

	if (b->length > VIDEO_MAX_PLANES) {
		dprintk(VIDC_ERR, "num planes exceed maximum: %d\n",
			b->length);
	if (!V4L2_TYPE_IS_MULTIPLANAR(b->type) || !b->length ||
		(b->length > VIDEO_MAX_PLANES)) {
		dprintk(VIDC_ERR, "%s: wrong input params\n",
				__func__);
		return -EINVAL;
	}