]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
media: coda: don't overwrite h.264 profile_idc on decoder instance
authorLucas Stach <l.stach@pengutronix.de>
Wed, 1 Aug 2018 14:18:04 +0000 (10:18 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 Nov 2018 08:21:57 +0000 (09:21 +0100)
[ Upstream commit 1f32061e843205f6fe8404d5100d5adcec334e75 ]

On a decoder instance, after the profile has been parsed from the stream
__v4l2_ctrl_s_ctrl() is called to notify userspace about changes in the
read-only profile control. This ends up calling back into the CODA driver
where a missing check on the s_ctrl caused the profile information that has
just been parsed from the stream to be overwritten with the default
baseline profile.

Later on the driver fails to enable frame reordering, based on the wrong
profile information.

Fixes: 347de126d1da (media: coda: add read-only h.264 decoder
                     profile/level controls)

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/platform/coda/coda-common.c

index c7631e117dd318fd52a82c2ef72e4e2e2a756711..1ae15d4ec5ed7b1b2854674fbd54fe7364d269e2 100644 (file)
@@ -1719,7 +1719,8 @@ static int coda_s_ctrl(struct v4l2_ctrl *ctrl)
                break;
        case V4L2_CID_MPEG_VIDEO_H264_PROFILE:
                /* TODO: switch between baseline and constrained baseline */
-               ctx->params.h264_profile_idc = 66;
+               if (ctx->inst_type == CODA_INST_ENCODER)
+                       ctx->params.h264_profile_idc = 66;
                break;
        case V4L2_CID_MPEG_VIDEO_H264_LEVEL:
                /* nothing to do, this is set by the encoder */