From: Hans Verkuil <hans.verkuil@xxxxxxxxx> state->info was NULL since I completely forgot to set state->info. Oops. Reported-by: Ezequiel Garcia <ezequiel@xxxxxxxxxxxxx> Signed-off-by: Hans Verkuil <hans.verkuil@xxxxxxxxx> --- drivers/media/platform/vicodec/vicodec-core.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/vicodec/vicodec-core.c b/drivers/media/platform/vicodec/vicodec-core.c index fdd77441a47b..5d42a8414283 100644 --- a/drivers/media/platform/vicodec/vicodec-core.c +++ b/drivers/media/platform/vicodec/vicodec-core.c @@ -176,12 +176,15 @@ static int device_process(struct vicodec_ctx *ctx, } if (ctx->is_enc) { - unsigned int size = v4l2_fwht_encode(state, p_in, p_out); - - vb2_set_plane_payload(&out_vb->vb2_buf, 0, size); + state->info = q_out->info; + ret = v4l2_fwht_encode(state, p_in, p_out); + if (ret < 0) + return ret; + vb2_set_plane_payload(&out_vb->vb2_buf, 0, ret); } else { + state->info = q_cap->info; ret = v4l2_fwht_decode(state, p_in, p_out); - if (ret) + if (ret < 0) return ret; vb2_set_plane_payload(&out_vb->vb2_buf, 0, q_cap->sizeimage); } -- 2.18.0