msm: vidc: add check to ensure buffer size is 4K aligned
Input and output buffer size must be 4K aligned for both encoder and decoder session. So reject the session during msm_vidc_qbuf, if alloc_len is not 4K aligned. Change-Id: If555f26f1658ce50e12a8533cb9d59134da0aa81 Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
This commit is contained in:
parent
e047e8e387
commit
a6e8541864
@ -340,6 +340,12 @@ int msm_vidc_qbuf(void *instance, struct v4l2_buffer *b)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!IS_ALIGNED(b->m.planes[0].length, SZ_4K)) {
|
||||
dprintk(VIDC_ERR, "qbuf: %x: buffer size not 4K aligned - %u\n",
|
||||
hash32_ptr(inst->session), b->m.planes[0].length);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (inst->in_flush && is_decode_session(inst) &&
|
||||
b->type == OUTPUT_MPLANE) {
|
||||
dprintk(VIDC_ERR, "%s: in flush, discarding qbuf\n", __func__);
|
||||
|
Loading…
Reference in New Issue
Block a user