From patchwork Sun Dec 12 15:42:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 32332 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp4313773iog; Sun, 12 Dec 2021 07:43:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJz+hV/Mk42jGeY6g5qu6ZvBDfC8+ABRX/gyHrIyWO6Rlgs+o32azUugEdJuFNtvI4yiKBxD X-Received: by 2002:a05:6402:50ca:: with SMTP id h10mr54207299edb.70.1639323795149; Sun, 12 Dec 2021 07:43:15 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id j19si16752711edj.137.2021.12.12.07.43.14; Sun, 12 Dec 2021 07:43:15 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@outlook.com header.s=selector1 header.b=IbzG8DiG; arc=fail (body hash mismatch); spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CB67E68ACF8; Sun, 12 Dec 2021 17:43:11 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-oln040092075095.outbound.protection.outlook.com [40.92.75.95]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 40E5D68A583 for ; Sun, 12 Dec 2021 17:43:05 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mHxkZddZeCQqe+QIFuNx5rILLIlS3Vo9gEAQpQjVlOiq6HJBND57gk5WeqWVcCEfNaDDa+6n43KeFkiQzWlAE8D5Au4FDkBLreL4n6xh8NMoOBq+FHH2wKJ59IvWAfcVMc3pjARjFqVgMSC92IJj3zqoHQGLRxM51TPWS9lvTeyJA37ZKjQYVRVWrJVkGj+PxE/WgGJ6lD+Nvvc8sGZwd7tdBc0DbiswFufq9AIjVHcs/5NzcnHSHaJC2RcUcHWzbHBEuy4HlRJUUaZ/c2IIF5AkVO+DGeoQA2HhrRXFZJcy0G5spLtg+QJxsRzJbJHROsIWd1+P21YC/zauLDH1mA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=u4MikJMlvJ1LQwGBAeBJunn6yuAT9T5Jb1bEmTwDRY8=; b=PpTI+dg3wdrAOYdv8CcG8tPOYERmuK1tlZGEwQO79Ine0Xb1nN/m0sjBYhXf3LRbbL9jtYd9Bq+BReoncmla/wz+gZ+xo77fyrxQW1Q+yCzVd1zaf7BnlW+BezOFpdB0S5Dx5Gb4i2srsh43A3c20ZnYgGYWnQx33ZivLl73VPdGcWLixlGlKY3pgzPu8KRqSPSm6Zw2DkjTfh1ZTbe9yu17oGeDu2aeH4Mv2lKeZGZ73bKnIwKc2/ZDH4NctE0vSTEUa1hJ6g5aGCWG98GERmKB1HVvnx+sZxNJoiovF3iuRJbhyujvXQtNvTJClPEScYyruH2BwJ7WuxvSf5/r8Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=u4MikJMlvJ1LQwGBAeBJunn6yuAT9T5Jb1bEmTwDRY8=; b=IbzG8DiGsPj8TnNt2OdG2PUKUChrKwy2ZrFqmapuYsn82p4U188rlKf/y5oxcGqwgGuKSrFGp4FpxbTSxBCw8TL3kZ+aUqjkEgTPO4snhgvyiym07K930Qhb/gArOrz4ovizL/TqKjZkku2onhvsyPovCZ+SilgM2cLBYuxhHVbZYogVJzmndrEb5k4B+B0ymHZIKv6GT2/9MFE6LeKqU9VoMS7Cn+j5/cMRJZhgQUeB187oKo9qX2wHJjLhVliCZlTauplJr8icFgeKVWACGj5g39yBH6mrwMCffIkRJQdk8flreMbKwaB/34JDTdSPaPkVAmM/8hRCIzXjVM57ow== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AS8PR03MB7112.eurprd03.prod.outlook.com (2603:10a6:20b:297::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.16; Sun, 12 Dec 2021 15:43:04 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::f0dc:92f5:6bc2:45ca]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::f0dc:92f5:6bc2:45ca%6]) with mapi id 15.20.4778.017; Sun, 12 Dec 2021 15:43:04 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 12 Dec 2021 16:42:54 +0100 Message-ID: X-Mailer: git-send-email 2.32.0 X-TMN: [lIxf9vpVb4tUI+FHc0dniuNLJgBG0MmL] X-ClientProxiedBy: AS9PR04CA0056.eurprd04.prod.outlook.com (2603:10a6:20b:46a::24) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20211212154256.1511544-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4188f53c-9669-4534-0b01-08d9bd8615bb X-MS-Exchange-SLBlob-MailProps: S/btQ8cKWiRhTeYa9y1Ya27Xypab/6mEutVvTfhKPnAMlCOw65Ho6Z7T96nTTl7GcvZ3S2qGS9XJL6GX3KC2gn7E8GeIw0Ltarm92FdOHVNEbGKz0RtK6a6NoDsPZebQoY1LfwSe4l0O4dtcPq1Zcv//irqQGEL1XrO0BwNTIsid0n0Y5ZrIEzwmK1jp79+Kx/8vNyFJcH2PgxZCQWhAboMQjzXm8AbWpukHoI8loo7/G/lV3Zrbg3VwNKR8PqnwXcWbrg/BjcI2rkQQQjIGwz81XV3I9QSfcqNvvsA21geinqEAKHhVKJMnk1PRlH02cr0fEqwiBiCUAOQTgERbC8Fq+lYx/jEfh7Kjhe52a+aPCtwd2YbZwW+Wf6ejy68Nuw+CLy0Lmhn6hf/dzB38nau23NcbGrhPdzCP4NB+bVXocwNr8b7L2eSu/f4SZhHtQujdmBcBfCCv1RE+uftMtLP5EHGMwYOfZBbZSh+yygktwDc3O6f8CdE3vTFjkk1L/MP+664Jqic15vRgAmEwggaJSAiXagqJw2F27yqO4n+y6+WCJskvMppzFuxQMYWFCCBQkjNpFhUdlZtp5yuDKnS4yXGAIgNSt3hzlzE4Fp6xFOSrgBWksHx7XGtQL+PJmAYASqgpq1S3YApJyB4+RuoCpE7l9ocZ+sbedyMJnSWW1aNb+A/LE66RgqtEEFwrSnVGpQ9OOcxYwGGDcCjA7wvzuW9zRpdVsXa4Poj8bUSDy8JLdg453KSyhV+Q+Ud3QlJU9pMZaGU= X-MS-TrafficTypeDiagnostic: AS8PR03MB7112:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BUn8q4Zkl9gCJ6A+kmQjZDV7UWkE0of2xYdPyvHjnUPEr5/F4hUcg6LKUi98mAbf9sQeHmzzmcK0QxikHhicfD21otpbiZnHe2n3aYSsjBVjX06hyq4aJcBK04zMPV76IdC1VcRUrA95MFrCGDsgfZw6JYMTT1AS+PCZy34gawgEfhyZgF6oyfBrejbNPipFutu0iYjz5BbqoBccatO4R464UPZIjeXh1Ij+jNe0gnYrXvct4LKXr346c90MGFiBFKXeB4ivob39k5MGn5zPKlz38peWEvb3ab7oLH7kimyteKHGTI9AKuw6pc/AZHT50tGtSxL1Bn4G39JAxdDLPJ3AI67xA4xr8/MylvsWYPEqQzfkowRR9DIXSun5RESksLmfFreDPprN6DHHrGx0EWWSo15fNm17T77U3RMGF615oYLv2rUcmTg1e/YM/vDsuTa/GZ2e/C1ZA6TQnkQwgc/XT1LZLOp4pQaBa0RmRVRJBoZXxTbO20ocCt981MTgBaMi8WoM8ZjMOnH2fmJlqnfVotB5HcIKC8WqZNR9yQAeff6GfILIdjurddBz7W+EQ5WLfMx6d1ubub8h1UfAIg== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 45x+nUG4ze8QWrPTpkjDRnBoA+q/d3O+CnSFpk8Yt8lCvaiA1SG247thqrZe2GiSGdXt4WhJE608YnipwNE0S1au03y6Bfqc/z5EOmjrCFszCg21SA57M2awfMDK6WHrcdSKSZdWeMF8/I2/el2qnz/M8kZV6SAum5gc7cPJZo2YV9VrKzXj0qVU/g7Vo23WXbECa7h57lJRwzee0KH/2bIAFNuBPKuFjRgPkd4pHX4IokwruHOI+ZS43l3De5LOKQ/rTHHFHW234T7Ipz6k0080mVJpgnDMA8EBMIhw/1CTaiWhOJqr7ydsWU+WP3t9QZiFjXrDHICDfjdDxf4XTEwrqUliX/0YRdHZZoHU8RVIOvtiUJExbxP0iRCPV9sEswKN/7HiwBxDHD+B1baBeqQ7uuljMmguj1i/IitHs6bVozdQ/3WtO1zFKKYil8/DHqnoj9PMNTaBfLqF4EjlfOb+jYF/MFMIibWIZUqsrXut77xtnuwcvko7ufw6iwbMqSX9RInPyXFDUed5kiC3JHUccwqc1Jb/0YNNSh8Wz1atyKupwhZp4kMbCvj+0pDuhy1oOQxQ+kzdkrdSQbAIpmx3alDTr6kNCJFv4Iyu8jiv5NlMZHSAIWEn2CzFMhyhagYRK3d+q1ZmksFmUsaShh6VW/Vrb2oYFlA7kSrLzyp7Mh4Wt6acDE76zmZpAK4aelRDbNJU+JS5bExSQdneZfltCneGraBanKyUTagj3q5PlvYW1CHb+5M+GxgCqXxl23gzosCLmMZG+q377svyY5ucrwO+0DrYlEhUhmvWzQG0ChSmSqaZk5JpUIfnN/QFBkvHfNT0CisSwD2mrnW9Ic9anuAlcsYFlKPatlav+96r/GMM7ceTMgNagTm8r5nVgNsyiuiZw0s5gUra94JmT8MlGZl+JJRfQFkMmaJz0l9q5hY6TYebLu894Fj+w/6/zyD+Fh6NpqJ5vtcK/Wgu+w== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4188f53c-9669-4534-0b01-08d9bd8615bb X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2021 15:43:04.0607 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB7112 Subject: [FFmpeg-devel] [PATCH 1/3] avcodec/speedhq: Replace always-true check by assert X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: DJx0CZBzuFql Should fix Coverity tickets #1473572 and #1473504. Signed-off-by: Andreas Rheinhardt --- libavcodec/speedhq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/speedhq.c b/libavcodec/speedhq.c index 91ba80ebd3..743dacc6ce 100644 --- a/libavcodec/speedhq.c +++ b/libavcodec/speedhq.c @@ -295,7 +295,8 @@ static int decode_speedhq_border(const SHQContext *s, GetBitContext *gb, AVFrame if (s->subsampling == SHQ_SUBSAMPLING_420) { dest_cb = frame->data[1] + frame->linesize[1] * (y/2 + field_number) + x / 2; dest_cr = frame->data[2] + frame->linesize[2] * (y/2 + field_number) + x / 2; - } else if (s->subsampling == SHQ_SUBSAMPLING_422) { + } else { + av_assert2(s->subsampling == SHQ_SUBSAMPLING_422); dest_cb = frame->data[1] + frame->linesize[1] * (y + field_number) + x / 2; dest_cr = frame->data[2] + frame->linesize[2] * (y + field_number) + x / 2; } From patchwork Sun Dec 12 15:43:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 32333 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp4314460iog; Sun, 12 Dec 2021 07:44:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJzMH7A1go9MLTycxihtEd0k/oA4cGuS2llQI0IUSbhl4MJzxU/HqE3CR7hTICEcgUo6f7mo X-Received: by 2002:aa7:c9ce:: with SMTP id i14mr55250049edt.300.1639323847230; Sun, 12 Dec 2021 07:44:07 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id dp2si16892373ejc.551.2021.12.12.07.44.06; Sun, 12 Dec 2021 07:44:07 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@outlook.com header.s=selector1 header.b=UI8h32Gt; arc=fail (body hash mismatch); spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E8D5E68AD8B; Sun, 12 Dec 2021 17:44:04 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-oln040092073097.outbound.protection.outlook.com [40.92.73.97]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 62949680134 for ; Sun, 12 Dec 2021 17:43:58 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aHDn4ZTLlFsCBkHNP9xdcfknWlSuTHdiNadYzWorbJ6xTT4Ye3NGRLkMrHmwRAsf85K8lE8uDbJsXFcML3WTby4xZXFnnFwpom/p+0lDfG3qmigPlJPZWSHw4ll5eFdPHjUKSgkWoHuphJVkYjWeHZEPHx2c1dY2GLS/QMnR17X4KSSCbKKZwh1969dpPmqI6bgAwTUnA+HBtURw1mKKRSw/hE5Gx7qmtzrHrh0j2AHYgbVwtEAfC3I9uOpC4FSnREwf/zyis7ZNasIfa+d1WoFjcJBXv5kiKob/A6Q78IAKW+nSa5PBaAhc/8AkDla4GpcCZ2vvQ4Sg2tVz12b+Dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=KrD6uZmsCeE+C9aYREw0SbMxbEv2RqKvzkmVVvplO8o=; b=DTurO8KQCPayqlwAyMusSf43FumrQkgaxMerm7/CaQsXN2j7QSez7PPSHJlCAotFyuVG22pop/E03ZkyvHIVXi6lRulvDW778c2vAlbHaO8cefgTi55rrGPn02I+cpFJULo5UThnfy2XfamepZCkViY2nIlZN0bQ1KSKwLIZt6H7Mxme34CDoikRPolRG4YQqL43spHNxr87YnUMoLvBdG7UpROGW6l20dqDAqxyWTcJVo6NbQNIeYIdOu372jEhURFfe9xKu+E/zlX0c3JMH97XAUawHQa6lMRtxXkH1BDg/IOl1wVRLCPzvmc/VrY72+tQZCUl0PfrdmaQKs+XQg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KrD6uZmsCeE+C9aYREw0SbMxbEv2RqKvzkmVVvplO8o=; b=UI8h32GtP6k4+TVok0hW5CfDVNgtCFnN/atyyLEuIhyGra9AGUEglsCuFpWwyWToTggvmapK1ajS8HUr5fr2sn9e1J6nFFBhUQ7vQP4V9Qizq6++wgf/5ilyDq1UTwxxhiAMGV9dgi12uMkeyPMdMmvqVzUw25XEE8H/KUUaNxcJrYbkDxyVdjp9Bck05tldoTUfhdwpWzQIvX74JsCwo4GwstzEHZE4ukO5/adHvFV4GQXZidEhP1fJV453YmJqUVwR3cX52zEccevh0jYRLAq5R3hnlUpXI+27CAN9gOUT424CPyz+Wwbce6yKGgtv80Udc2XLl3DIPULfX6oE7g== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AM6PR03MB4615.eurprd03.prod.outlook.com (2603:10a6:20b:1::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.21; Sun, 12 Dec 2021 15:43:57 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::f0dc:92f5:6bc2:45ca]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::f0dc:92f5:6bc2:45ca%6]) with mapi id 15.20.4778.017; Sun, 12 Dec 2021 15:43:57 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 12 Dec 2021 16:43:49 +0100 Message-ID: X-Mailer: git-send-email 2.32.0 In-Reply-To: References: X-TMN: [THo8ffcJqXjYgvp3IT+nkvJ0tQfuXG1E] X-ClientProxiedBy: AM0PR02CA0142.eurprd02.prod.outlook.com (2603:10a6:20b:28d::9) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20211212154350.1511901-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 651633e6-d105-4d56-fac2-08d9bd86355e X-MS-Exchange-SLBlob-MailProps: S/btQ8cKWiRhTeYa9y1Ya27Xypab/6mE37AYKnpe25AAjzrhTHPbYGuqwVLdEAql47YDT2LsVlWYOfNOlfHOzNN1KWnE6laVYO7HWOpI2zGBMONpzgesDxuv/+gVrt+AltwDfcTK7G8KdEF13RSeCCA+VC3pAEZbQzhHYjq/k5i6kfzgbp2Gncg6Kx6wTH36w14oCbM+9RHTic9b2/DHWDkowzcAvlrI3RbiDxAV/2XMUPrsxkmqH/OVzKiIFGIMdRl238xAVhOevOT/Rhn+Ic3BAZ4MgJbDozEIW7UVGT3YNQ0tptAQTm3vwOU3QQ+gZM/nBd8BiiC8S37K11G3HtFKYnC9OBS9j3uHP1Iez9f96GS77tFRUshBOb8CCYzo1pTFyo5gKbmelC0lFf3XciUZzDGxpKPKk6ENxKrbmdbAph87FZxwoCB7SmLZOSXIzrd/AmKoi4TmxT54AVdWjTBq1k9CPmfoodhgpCmDBDzL4ZJdqOAUB1GWNOvSHbhpUfQKRlhSjiAdjDZbReP+H0pYbP9byzTdgucl49eoJXV6uwou/yJOoozbZRKfNgW8G7v7ABvyuIhIG6OG+IV+UtoPktYY46Kzz1JmKwgeWhBrCvEGueO3s6ld7a1inURhzF35PCM8zeOpWNY1cMHFcMeOghXiR+yj4X3+R32zjWHa74yTnZsVBmLehxUzv1PrLZSyk+K1gzdCwuzrWP/35TvM2rrS03WamlEHzJaXvzUJtEP+Bl1PonQgS+V5dFZatknX8oOM3Vo= X-MS-TrafficTypeDiagnostic: AM6PR03MB4615:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VdYUlB+Y+KDBG9ZDsM4hiFJqW4npEb2kcAlpi8llvRgA4QHrIg39oO5j59SgRku7x7OGNWUunxrmGl4P72vqmekS3hBPPAXBrklq4JMK7m71FEwL01JBpqx9npz9XAaxnPIhw76Ji3wd7Qj0RDmfDOi5a23PBsTYPriNOanciIAtiV8Xrwd5/CN4UyAbIIZiL0OaE0KXNh74aceLdpHiWn/zi5/vFzfebbFrmZ8vpMBQprCm1Jg48Np87J9A8U+f2hRL+YnYRcBpF2sAun/l9Zd5+kPZ/gSERcG9tj1EvPEdVeG/SpeSrRVe/I5ZupTRQjgxePxECodJOaKrtKoHAsg5lHMSELF5f5d/ow3rdJUoj1YwUhFH/3n0PL9Jt4JjK5kpxTH5NxrgOzp3u53dQI4WZh8jAXJ5dmoJ7g719vFtkZXa3qtKzs/4T8sBh3b5Mz1LgcSEwnPai6UACDiTWkhpVrq1SjahYk46T5sMtpuJ2vVfZ38j5ns/fLcbkLgufy7mmYa56yckLyxCERxcpIgiNZug8HkMjSSrFTfcBea0SaHOsut/jk+GkqnCu2Weg2ofcv7pjLKKVy6h1m5lEQ== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: k0blRJoca4Yh3ZYunTtgE36LinF3cWzHd6CwalOrdF5tFKqk3IlMpbo36It6k3119HlRLlW8CYcGlXLHjLM5qrtT6jSe5q037WtvOWeW1gXMCTyNWqezoYlPaRUPWls1LftOM40VasLO9FsJtubiyccsNuuj8P56PLNzjMuDrb929NnSw49nOg7apjAqx+jcnCclZpfrF+zNBa3+PvFc65pO5qbhFHFLbVL34UPcevGJHN6GRKZqYCzLYz7XMwDQA9oQu4Oe9lOpn6lAGsynrRPaq8jPvd4uOsZmBhDX+cwIu8HUcDRXCOQ9TTP8UBP2aZpCC78ajh06o9KQqED7TwyRYf6QshunHSKA0+cvU2NdwwZ34IXKr7fsZRQ2MJv0SXhg24RyEA5pa48f+BzMbh0XWcfll3q91ib8VoqHab3dcWp95xOaBF/GMeFbZ8ovtEALIm6YWOVITWIdoNk3ITxR6SFbxmYXO9s2gq06De5OI6x9hurr4amJLruqVh4fGdYXauZo2Jtq0WgqMCUoffiZQnd1HjLrnwY9rfchmCAWD8pjQBUoBZMnIYyuCH3JEYRWbQzctNLq4ayblPmAtJXsN1aI1SdjGdf4TrPzF+/OQ/ItHrV0YYjNw255NsdrWbb4MKsYpK22AvnjiRulJmMdeTFsGTM/d2drUoWqUcQhLbCVYYaNUyDtzJQFlS8rocrRk2w1C03fsiFWBYTCEca6wCrIvgdBbZmTGjr/nP589wERsfnsidvedpeGa2xS68vOMc0X4LfJktLcE5etQxW98K9uXsnlq4dr1BiDXbMTJCu8k+IcAN5nEVzu5cUgbzYPKFFRwohX51EqMReyGlkTCI5JOXR4orpuAI9YVBK5cqCHQk2JkABA+/C41EJqphtMAyrRjcP9RNt06PNStvTVUvLapMUrpC7cH1yye7EpopR2qJTJHRRPD/XC6Rj/kJzG8tO88Mk+n/KjXnJhtg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 651633e6-d105-4d56-fac2-08d9bd86355e X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2021 15:43:57.0194 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR03MB4615 Subject: [FFmpeg-devel] [PATCH 2/3] avformat/moflex: Free AVPackets via av_packet_free() on error X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: CRSppdS+TWip (This is not a leak as long as av_free() completely frees blank packets.) Signed-off-by: Andreas Rheinhardt --- libavformat/moflex.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavformat/moflex.c b/libavformat/moflex.c index 234b0fb06e..67adebe5e0 100644 --- a/libavformat/moflex.c +++ b/libavformat/moflex.c @@ -383,4 +383,5 @@ const AVInputFormat ff_moflex_demuxer = { .read_close = moflex_read_close, .extensions = "moflex", .flags = AVFMT_GENERIC_INDEX, + .flags_internal = FF_FMT_INIT_CLEANUP, }; From patchwork Sun Dec 12 15:43:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 32334 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp4314603iog; Sun, 12 Dec 2021 07:44:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJwkaXgTPCM/P62hvafGzH2LccDKPW8zUStC8HnadBViblv5uTI8x713Ciomz5HIULWFdyKB X-Received: by 2002:a05:6402:516c:: with SMTP id d12mr55395138ede.391.1639323855889; Sun, 12 Dec 2021 07:44:15 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id l10si15833967ejo.308.2021.12.12.07.44.15; Sun, 12 Dec 2021 07:44:15 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@outlook.com header.s=selector1 header.b=OEZslpNr; arc=fail (body hash mismatch); spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id ED4E868ADF6; Sun, 12 Dec 2021 17:44:09 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-oln040092073097.outbound.protection.outlook.com [40.92.73.97]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A5A43680134 for ; Sun, 12 Dec 2021 17:44:03 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZyGzne9XICPc8h03arl1ZAnewsNpZ0NI94dzZdybCOcpzssvV9w/ix5JK+1NMZJi+qzCuG33gUjuVnVNcaomVZ7CUcsKrQLLOXhKHMFn+rhKHU/fi7baoc2lfo6HWyARaidB9HdNFUCw0Fc4sZOs65TY0kjkhbVvU79be/6E1H8QzggbITR9h6CDEsv1s+SrbNNvTR+0IemunURGxlT74E1Rb9HdugTNDSb3OgIvW92L8yyyM2ifqP4IfdxfHfnHlm1N5h0uYQbM35e25Lru8owkN55dQohFQWY5uVyA4sBWh/OLpf/Kyc/RdvwoCMBnU3DUSZgay2Rh5W4PrGcYaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=DE3VVIxViCSiQENG5pzwRoOaAxl3p4VeJNhVtnm/vqw=; b=SFM100eZ2Ve+QK0r4i/N5LFVMGTTxA+Uaxxwi1MQWyj2oWIAGnthbKeXPxVKr/eNiynzbRoZWkgIv8nsCFN0ncR10CIvW1mscm/4punUb2PFGz976HjLuc0S6edZFi2bfzXorpAwk74kFiGs4VT3x2hY7RsW+c4cxyNukOLmAjJ48P7ioaAJuP9Ap+Wnk5qmbEEco/v2lB5LNBXl/fBxofSuBI2H3hfFzla5Y2p0eTex4mi28djG3+9cTktJ2rN7/ECGQWzGThEKoM/wPe0AdPhhQk/Vocb98i9PXtSShFjt8y/82HsFlEQEfxF65pW/nDQiVIO6nzIsnelWV/zj9Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DE3VVIxViCSiQENG5pzwRoOaAxl3p4VeJNhVtnm/vqw=; b=OEZslpNr6eLkH9H7r00CekcUcfEXW+dOgcrIM6NLCpUNk98kqkxu3d620C9g5qijqgeok0n5rt14qh3K/nGiWSFDxR5pFAfX3ZuXo2e7+ba6UJrMQmNu6P+XeuupZBr9yHBjfE7QyFlz72Q681pSbx7pD+bxtZf+krCwgdch7Bmls28OsQmieqBAvnUycKu62vnQS+JEBSUyBYkhcZOlPzFxAhXNMWcVpzHBXv0xYPN0gkZNTzYcoKLiqx/d2Ts/XsAWsgvsl6eNizFJLd9vF5VCaxKqY42ukhGlKi/t3YtYlHwF5Pi4CD1Jmsepbm7CkyiG5Pm2l8cPRDjGfYf6zQ== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AM6PR03MB4615.eurprd03.prod.outlook.com (2603:10a6:20b:1::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.21; Sun, 12 Dec 2021 15:43:58 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::f0dc:92f5:6bc2:45ca]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::f0dc:92f5:6bc2:45ca%6]) with mapi id 15.20.4778.017; Sun, 12 Dec 2021 15:43:58 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 12 Dec 2021 16:43:50 +0100 Message-ID: X-Mailer: git-send-email 2.32.0 In-Reply-To: References: X-TMN: [fmPA0PLE8T+9L6h6+IWyhDeFzNy+SzYb] X-ClientProxiedBy: AM0PR02CA0142.eurprd02.prod.outlook.com (2603:10a6:20b:28d::9) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20211212154350.1511901-2-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d26bfaf1-fbbd-410c-15ef-08d9bd863601 X-MS-Exchange-SLBlob-MailProps: S/btQ8cKWiRhTeYa9y1Ya27Xypab/6mEaHfnqmFu+YEJtp5pDCI4/X7sTotJ+b9T9PtzHdxmKtVUD4+fir/R1KPj+f50mL4n2Q7ZWfDwtb3cc1hCydabMNmFZD8qk02MG+XB+D6fm4t9/oO3UsrtHsecdi56icDUEXtTxXTTQjcuty3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gdta/kHb9UPP0k/mEwokMrUwvuiGhfXeKHuAKI0UMZWXMKrnj9vujsgC/UhS/eRLRv2jOuk8dfAIyvHXhtFHsUmZwP5O/h7VfgGhGiNfik9oIZe2MaoH7EwEzgy2ApWwfTfmT024z+ZmYY2p/pzvzBu1IcNkUn+6ESR8wlOluBPCeNlGqByGneA== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d26bfaf1-fbbd-410c-15ef-08d9bd863601 X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2021 15:43:58.1130 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR03MB4615 Subject: [FFmpeg-devel] [PATCH 3/3] avformat/moflex: Don't use uninitialized timebase for data stream X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: r0UzDeGwmvvX Signed-off-by: Andreas Rheinhardt --- libavformat/moflex.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/libavformat/moflex.c b/libavformat/moflex.c index 67adebe5e0..1d342417f7 100644 --- a/libavformat/moflex.c +++ b/libavformat/moflex.c @@ -172,7 +172,7 @@ static int moflex_read_sync(AVFormatContext *s) unsigned type, ssize, codec_id = 0; unsigned codec_type, width = 0, height = 0, sample_rate = 0, channels = 0; int stream_index = -1; - AVRational fps; + AVRational tb = av_make_q(0, 1); read_var_byte(s, &type); read_var_byte(s, &ssize); @@ -195,6 +195,7 @@ static int moflex_read_sync(AVFormatContext *s) return AVERROR_PATCHWELCOME; } sample_rate = avio_rb24(pb) + 1; + tb = av_make_q(1, sample_rate); channels = avio_r8(pb) + 1; break; case 1: @@ -208,8 +209,8 @@ static int moflex_read_sync(AVFormatContext *s) av_log(s, AV_LOG_ERROR, "Unsupported video codec: %d\n", codec_id); return AVERROR_PATCHWELCOME; } - fps.num = avio_rb16(pb); - fps.den = avio_rb16(pb); + tb.den = avio_rb16(pb); + tb.num = avio_rb16(pb); width = avio_rb16(pb); height = avio_rb16(pb); avio_skip(pb, type == 3 ? 3 : 2); @@ -237,10 +238,8 @@ static int moflex_read_sync(AVFormatContext *s) if (!st->priv_data) return AVERROR(ENOMEM); - if (sample_rate) - avpriv_set_pts_info(st, 63, 1, sample_rate); - else - avpriv_set_pts_info(st, 63, fps.den, fps.num); + if (tb.num) + avpriv_set_pts_info(st, 63, tb.num, tb.den); } }