Linux-Media Archive on lore.kernel.org
 help / color / Atom feed
From: Alexandre Courbot <acourbot@chromium.org>
To: Yunfei Dong <yunfei.dong@mediatek.com>,
	Tiffany Lin <tiffany.lin@mediatek.com>,
	Andrew-CT Chen <andrew-ct.chen@mediatek.com>,
	Hans Verkuil <hans.verkuil@cisco.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: linux-media@vger.kernel.org, linux-mediatek@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Alexandre Courbot <acourbot@chromium.org>
Subject: [RFC PATCH v2 01/13] media: mtk-vcodec: vdec: fix incorrect pointer dereference
Date: Fri,  6 Sep 2019 20:55:01 +0900
Message-ID: <20190906115513.159705-2-acourbot@chromium.org> (raw)
In-Reply-To: <20190906115513.159705-1-acourbot@chromium.org>

From: Yunfei Dong <yunfei.dong@mediatek.com>

mtk_q_data::fmt is actually a pointer and must be dereferenced as such.
This went under the radar because mtk_v4l2_debug() evaluates to nothing
unless DEBUG is defined.

Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
[acourbot: split into its own commit]
Signed-off-by: Alexandre Courbot <acourbot@chromium.org>
---
 drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c
index 26a55c3e807e..653f111532ab 100644
--- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c
+++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c
@@ -284,7 +284,7 @@ static void mtk_vdec_update_fmt(struct mtk_vcodec_ctx *ctx,
 		fmt = &mtk_video_formats[k];
 		if (fmt->fourcc == pixelformat) {
 			mtk_v4l2_debug(1, "Update cap fourcc(%d -> %d)",
-				dst_q_data->fmt.fourcc, pixelformat);
+				dst_q_data->fmt->fourcc, pixelformat);
 			dst_q_data->fmt = fmt;
 			return;
 		}
-- 
2.23.0.187.g17f5b7556c-goog


  reply index

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-06 11:55 [RFC PATCH v2 00/12] media: mtk-vcodec: support for MT8183 decoder Alexandre Courbot
2019-09-06 11:55 ` Alexandre Courbot [this message]
2019-09-06 11:55 ` [RFC PATCH v2 02/13] media: mtk-vcodec: vdec: set VPI IPI handler in one place Alexandre Courbot
2019-09-06 11:55 ` [RFC PATCH v2 03/13] media: mtk-vcodec: vdec: clean up vidioc_vdec_s_fmt a bit Alexandre Courbot
2019-09-06 11:55 ` [RFC PATCH v2 04/13] media: mtk-vcodec: vdec: move stateful ops into their own file Alexandre Courbot
2019-09-06 11:55 ` [RFC PATCH v2 05/13] media: mtk-vcodec: vdec: handle firmware version field Alexandre Courbot
2019-09-06 11:55 ` [RFC PATCH v2 06/13] media: mtk-vcodec: abstract firmware interface Alexandre Courbot
2019-09-06 11:55 ` [RFC PATCH v2 07/13] media: mtk-vcodec: add SCP firmware ops Alexandre Courbot
2019-09-06 11:55 ` [RFC PATCH v2 08/13] media: add Mediatek's MM21 format Alexandre Courbot
2019-09-06 11:55 ` [RFC PATCH v2 09/13] media: doc: Add documentation for MM21 video format Alexandre Courbot
2019-09-06 11:55 ` [RFC PATCH v2 10/13] media: mtk-vcodec: vdec: support stateless API Alexandre Courbot
2019-09-06 11:55 ` [RFC PATCH v2 11/13] media: mtk-vcodec: vdec: support stateless H.264 decoding Alexandre Courbot
2019-09-06 11:55 ` [RFC PATCH v2 12/13] media: mtk-vcodec: vdec: add media device if using stateless api Alexandre Courbot
2019-09-06 11:55 ` [RFC PATCH v2 13/13] media: mtk-vcodec: enable MT8183 decoder Alexandre Courbot

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190906115513.159705-2-acourbot@chromium.org \
    --to=acourbot@chromium.org \
    --cc=andrew-ct.chen@mediatek.com \
    --cc=hans.verkuil@cisco.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=mchehab@kernel.org \
    --cc=tiffany.lin@mediatek.com \
    --cc=yunfei.dong@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-Media Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-media/0 linux-media/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-media linux-media/ https://lore.kernel.org/linux-media \
		linux-media@vger.kernel.org
	public-inbox-index linux-media

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-media


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git