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

Commit 5b9cc7f6 authored by Praneeth Paladugu's avatar Praneeth Paladugu
Browse files

msm: vidc: Add NULL check for vb buffers



The vb buffer queue may have NULL buffers as they were DQued
by clients. Hence before accessing them check for NULL.

CRs-Fixed: 2136771
Change-Id: I4d99bf24c2d26cf74455692f76b73311cf6f62c6
Signed-off-by: default avatarPraneeth Paladugu <ppaladug@codeaurora.org>
parent 336e98a2
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -307,7 +307,7 @@ static inline int get_bufs_outside_fw(struct msm_vidc_inst *inst)
			q = &inst->bufq[CAPTURE_PORT].vb2_bufq;
			for (i = 0; i < q->num_buffers; i++) {
				vb = q->bufs[i];
				if (vb->state != VB2_BUF_STATE_ACTIVE &&
				if (vb && vb->state != VB2_BUF_STATE_ACTIVE &&
						vb->planes[0].bytesused)
					fw_out_qsize++;
			}
@@ -315,7 +315,7 @@ static inline int get_bufs_outside_fw(struct msm_vidc_inst *inst)
			q = &inst->bufq[OUTPUT_PORT].vb2_bufq;
			for (i = 0; i < q->num_buffers; i++) {
				vb = q->bufs[i];
				if (vb->state != VB2_BUF_STATE_ACTIVE)
				if (vb && vb->state != VB2_BUF_STATE_ACTIVE)
					fw_out_qsize++;
			}
		}