media: coda: jpeg: set buffer error flag when header parsing fails
authorPhilipp Zabel <p.zabel@pengutronix.de>
Wed, 6 Apr 2022 08:53:51 +0000 (09:53 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Sun, 24 Apr 2022 07:46:56 +0000 (08:46 +0100)
If decoding fails because  the output buffer does not contain a
valid header, set the error flag on the returned capture buffer.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/platform/chips-media/coda-jpeg.c

index 6b19efc..dcb0bd6 100644 (file)
@@ -1355,7 +1355,7 @@ static int coda9_jpeg_prepare_decode(struct coda_ctx *ctx)
                src_buf = v4l2_m2m_src_buf_remove(ctx->fh.m2m_ctx);
                dst_buf = v4l2_m2m_dst_buf_remove(ctx->fh.m2m_ctx);
                v4l2_m2m_buf_done(src_buf, VB2_BUF_STATE_DONE);
-               v4l2_m2m_buf_done(dst_buf, VB2_BUF_STATE_DONE);
+               v4l2_m2m_buf_done(dst_buf, VB2_BUF_STATE_ERROR);
 
                return ret;
        }