From patchwork Sun Nov 25 15:21:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Karlman X-Patchwork-Id: 10696895 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 995725A4 for ; Sun, 25 Nov 2018 15:21:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 82BF929B1F for ; Sun, 25 Nov 2018 15:21:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 76C4929B26; Sun, 25 Nov 2018 15:21:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 78AAD29B1F for ; Sun, 25 Nov 2018 15:21:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726489AbeKZCNC convert rfc822-to-8bit (ORCPT ); Sun, 25 Nov 2018 21:13:02 -0500 Received: from mail-oln040092064060.outbound.protection.outlook.com ([40.92.64.60]:51896 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726179AbeKZCNC (ORCPT ); Sun, 25 Nov 2018 21:13:02 -0500 Received: from HE1EUR01FT031.eop-EUR01.prod.protection.outlook.com (10.152.0.55) by HE1EUR01HT224.eop-EUR01.prod.protection.outlook.com (10.152.1.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1339.10; Sun, 25 Nov 2018 15:21:42 +0000 Received: from AM0PR03MB4676.eurprd03.prod.outlook.com (10.152.0.57) by HE1EUR01FT031.mail.protection.outlook.com (10.152.0.177) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1339.10 via Frontend Transport; Sun, 25 Nov 2018 15:21:42 +0000 Received: from AM0PR03MB4676.eurprd03.prod.outlook.com ([fe80::b527:e8e:9955:7c03]) by AM0PR03MB4676.eurprd03.prod.outlook.com ([fe80::b527:e8e:9955:7c03%4]) with mapi id 15.20.1294.048; Sun, 25 Nov 2018 15:21:42 +0000 From: Jonas Karlman To: "linux-media@vger.kernel.org" CC: Jonas Karlman , Mauro Carvalho Chehab , Keiichi Watanabe , "Paul Kocialkowski" , "linux-kernel@vger.kernel.org" , Tomasz Figa , "Smitha T Murthy" , Sakari Ailus , Hans Verkuil Subject: [PATCH] media: v4l: Fix MPEG-2 slice Intra DC Precision validation Thread-Topic: [PATCH] media: v4l: Fix MPEG-2 slice Intra DC Precision validation Thread-Index: AQHUhNKRUWp/dRRbvEugocGCqJWSrg== Date: Sun, 25 Nov 2018 15:21:42 +0000 Message-ID: Accept-Language: sv-SE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HE1PR05CA0388.eurprd05.prod.outlook.com (2603:10a6:7:94::47) To AM0PR03MB4676.eurprd03.prod.outlook.com (2603:10a6:208:cc::33) x-incomingtopheadermarker: OriginalChecksum:304731EC8F065EAA74A4330CF19C8A774B6D439F672270D6CF4E17F157A908A2;UpperCasedChecksum:A6120580FF16A413588ABB129DE8B3F73755FEF355E437B114518B92ADCCD26F;SizeAsReceived:7708;Count:48 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [CtHC2hKZxlL9GqfPmNj9IDdnw3A7LCpP] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;HE1EUR01HT224;6:q/V+bRM7eO4wcOhPtVmmvKneRF+EY4MgOE46GJWd3NcetiF9G6tYsSMc+8EpZW5iJnwB6Ccq6GX0yEJwO1xRRBFe1L+7u+jnKXhnOR3AK+/qJSmPf8QvKft6xvsXhSwZgULlbxgB6uIwde0/j4KKenEFyylhDnCHQQD0v6oVuSyZvK6AAIcn2RxLgeIrpvj0wTCF45V5Yh8TU40SzKX/cArtkEWHg1VCvXNA8fJi+wGYjeXVWe3GO63wsL3sf0QBadQEfwt0PEOPIl3JI59y9u83M9KzRLC7fKGXVNwG9C2sFw5/FMZYsCC1Q3Z4opiyS2qq8N2F4ij5Z+RMHRN9jM6inZtnYtOancjRl+v9xMtZnsG2Jlq7nJodUkxETqs6+O+uR7UCmIERfADjqdgYSRx79btbJEK2MQFGQ177XsF/RtXRAQKNxC3+KdORuU7NzH2Gmmh9hmT0wKd2MnrIUg==;5:F8rk0xJyzKqqkANCixuA9K1ri20iMZ2MPPNzSBwpIsyL14N0xuooUL8dojHxH+xkFaipbifC943+XI8K0K4hJSJefhtSEN4ZKJHbJfaT0W1WTH7P05FdOB27W+UCPACUIBOwsaB9qAH2LFckeWnxjeyGOHCUPMuu0KCdPSDr67Y=;7:rkyvJgHa8J5mGfsOH9z/RSoh8wAVXpK6LSCRUSvGhXcIn9Ctt8fLZziyAdOQEaKasBJv/DoaK+FNvn0lkXJFlW5h+AI8EFMwczRkwPPzMxe/fmn0X/ytJffDxQ7kTnC16iH8qvmhUVXgVIKDJy6v5w== x-incomingheadercount: 48 x-eopattributedmessage: 0 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(201702061078)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031324274)(2017031323274)(2017031322404)(1603101475)(1601125500)(1701031045);SRVR:HE1EUR01HT224; x-ms-traffictypediagnostic: HE1EUR01HT224: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(4566010)(82015058);SRVR:HE1EUR01HT224;BCL:0;PCL:0;RULEID:;SRVR:HE1EUR01HT224; x-microsoft-antispam-message-info: s6HoLP2+Hs3MDAiiZhcfv1TxnzYMiM0D57W8A585atocWdDG++TXED+BMbZ3kTa2 MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 54485d23-c432-40fe-8436-6091d627118c X-MS-Exchange-CrossTenant-Network-Message-Id: 180fd712-d76f-44d9-8109-08d652e9b346 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 54485d23-c432-40fe-8436-6091d627118c X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Nov 2018 15:21:42.1423 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1EUR01HT224 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP intra_dc_precision is a 2-bit integer [1] allow use of all valid options, 8 - 11 bits precision [1] ISO/IEC 13818-2 Table 6-13 Fixes: c27bb30e7b6d ("media: v4l: Add definitions for MPEG-2 slice format and metadata") Signed-off-by: Jonas Karlman Acked-by: Paul Kocialkowski --- drivers/media/v4l2-core/v4l2-ctrls.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c index 5f2b033a7a42..129a986fa7e1 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls.c +++ b/drivers/media/v4l2-core/v4l2-ctrls.c @@ -1636,7 +1636,8 @@ static int std_validate(const struct v4l2_ctrl *ctrl, u32 idx, switch (p_mpeg2_slice_params->picture.intra_dc_precision) { case 0: /* 8 bits */ case 1: /* 9 bits */ - case 11: /* 11 bits */ + case 2: /* 10 bits */ + case 3: /* 11 bits */ break; default: return -EINVAL;