From patchwork Wed Sep 28 16:33:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38442 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp356402pzh; Wed, 28 Sep 2022 09:34:06 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5rLrnJtQF9Nd/z1wix5XJuLpnIO3jvRYeZJyF5WILbo+W63wWrn9KJ1CzihqU2AuExQFtQ X-Received: by 2002:a05:6402:414f:b0:456:c2c1:23ec with SMTP id x15-20020a056402414f00b00456c2c123ecmr28995273eda.420.1664382845943; Wed, 28 Sep 2022 09:34:05 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id e15-20020a170906044f00b00783aebc32fasi5020935eja.899.2022.09.28.09.34.05; Wed, 28 Sep 2022 09:34:05 -0700 (PDT) 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=XHz0PpOZ; 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 5241B68BBBD; Wed, 28 Sep 2022 19:34:02 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-oln040092065085.outbound.protection.outlook.com [40.92.65.85]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 409BB68BB73 for ; Wed, 28 Sep 2022 19:33:56 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Mnr4gBOI0/jwUL2H9SjpgVcRrdB404lnJ2XMZ8Oj84pNoRzCN7+nStsLd+cG2Ah0lN3+WXqqPmxXVEVJfPgu36JVFOUT3aZSpnLcvX7dS5oY2i80sH6WSNokiJOiefJL2N005cIi+TU0+LHnujjaEqTP9c3cK1iE3P4rREdKv1RzFd0kMpML44E5jllYywn7yyaRytnVG/I56oPg22QfdhGJmFEuWgRm6kODyH9NsEcRCOI2UvYvCTCvZ8jeTfWxo++j8Ei/G/qlzAcXP+N4bH/Z745avxAbC+hxHkvjnp5yf9sUP9LIEdKCRdygDlB9fdwoEdSgGdrfElmy63Nkuw== 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=uDmADVf1Ex46AXbLkt8EeOjW1bEeW2zbjOgj4+6V9IU=; b=mZMxPEc0kMEYF33f8WWf5Gu1NAVrAyVRqxanMrsgRHiV0js8iHJlG81bR6JSFdKGZm6r2pnCHEDpwjmoIjVf1UG8DsbEyZ48Jka09oipoeF0A0sVZa/Ar1DnLUYtvvc5BA/0MnlQltPmEm6Q3oaJD7PsVknxGvXmrBlqq8Gl1MSuXBQxK4/m3IJXN4+kNIpNWhnNPeoi8/KmeDwiZAny/jAp6NCLwF/qyK3ReMhc4QMjJrwkAdBm3ziS+G3ABKQpyIlmkJ8fO5AQ7oXkpcS4J7Xwug+5Ewf3Et1nHK/AQGaMvZxnlpd/TE+K/57BTDigFcZCQVJZROor4595ShdkbA== 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=uDmADVf1Ex46AXbLkt8EeOjW1bEeW2zbjOgj4+6V9IU=; b=XHz0PpOZTMvQzJF115NsWbq2W7v3iXlQ4zS20nEUjM06jiU/jlEpBJ9aC4SLnUxAi7W8IuZFZ7ixSj/39KFIkom+qx9GhSBwX5vjdmxjEMmUOLzyTiMQK2dXbkoQtmt06ZQhLUlG/8yYPIyvGHBD7wG1ieMhGfO3ekUVcgTlIdIbAvZ5zZ8cBe0H8vVg0zZ/NPFqJ5DPZ9213NDAq5SidxKM/uaC1lw5uHOzWOlkRHUVbdzauGMFsrDkpQhmkMglUhquykY2b3sw6ZlQye+doWbxnAyNxgjydL6k5fE4chBpK72fa7k5mJK1q5xT1ZXdRmSc/6FwBBGLfzpbP9wg3w== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by AS8P250MB0006.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:359::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.15; Wed, 28 Sep 2022 16:33:54 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8%9]) with mapi id 15.20.5654.025; Wed, 28 Sep 2022 16:33:54 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Wed, 28 Sep 2022 18:33:13 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 X-TMN: [bRoZVwkIej5/EZL6Ks6ArwuhTxsowGbhPA6+klrDy7U=] X-ClientProxiedBy: ZR0P278CA0127.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:40::6) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20220928163317.915868-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|AS8P250MB0006:EE_ X-MS-Office365-Filtering-Correlation-Id: 8c530ba0-e0cd-4a89-c465-08daa16f3bc1 X-MS-Exchange-SLBlob-MailProps: ZILSnhm0P3kh+Zs0i80mamVaMOhNuFW0UAjSFbZN0hDb1ZLha/I/MHx7yOnGsCIOsdlXttOb2LyDLA9atULFVR99tpRWJMkZYKbk1r6S/bsiCJGo2pVJMvWUF9Xno7qZOf9gYHpibONgQIftdHCHmIg/qpXqYdV4G514ffbLCH6ScrsKOmKY9z9VAajpV3N8QJTDNi/DAe5kZbKa1i/Gb9o7mwObLkp0PPOIO16epPN8N1f2/TTno7ZXUHBP4KfJjPrRfn3XU1+hsQYytgrr+px1CNx2x16AHhPjjG21UvHX6ErvWh+AuEzZ2SidfmSoul8KioCi/WB7yKQPCenDJ6Aue5wKLlWqyjz34tkFlmFZDWozcmgqZHTT1RSWxKscYZbvHieVTxjxkGcIYLE1Ewt1Z4Dyfzi0iyUX0m1d1RMr8ZVSQiDOUjaJbeJBgJfoj5W80v+omw37Ld0bmW3F6JLG+oWEXH+/Q8OfCtlII43KfIBta3LdxqHyYctbyP8Onc0WvBk5fZVCxkS9YqRp7RH1LaL1r/ti02bYbtCwMrNwHeDVOKuaKOtV5dDmC5A0YKu90g3DtXiAJVQv9rI4cTuS1SpeTaUpaYAWbTh0ujgXX7X/cTmbeRg5q0ydkO79PhcHg+0zuncn01i7uSymhzc/q4fDMmoGnxX8YvBV53CWfGLfTgrlnBR7nFnKLmZSTNL+5Wow+0+xrvQ5bcON7VoMHaGnTjQeTtOvGqzlbyeSh+CAxudAD+sK0mX5K0gQp3+ayafRaRl/iadnuHTuhsSAfe+NhPAs X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: n/JvMp24TtANlWAAzc6fA3Ba/dhjYsJCxMYWbZ0S+lnJR8DasFglIZwgYfyBja/ktRw9V8HXW4EdqplqvvDPlX9kf92XQ7tSrNh/4lXfKaieHUIPIn0JZgUWvUaC5X+f5x4lKe5YIKxd2Q2MFLq6vHvlrwLkwUViv6+EQK9LJccyKJMKoK5TFd49sMwLbyJtSu9Nx7W99CTFmNI2DTNjp48fY5AoUm2m96jKmsZ/Zfz/sxbHFlppWbHb4TXtdJGJIaMivZlwQ9Ts2g7LaAtARXCG3fg2MLL/yRPYD/W9eWM2sa8GG+3XSkm34kJbF1mdtOBQqigzSSK/2OqGSBeCTP3BJwu146D7G0ORm9bmP8p/ub9SY9bZY8DRo91JETHvXuoekr4KnIFWWILlVh/Hz77U8BBKgOZuH/95RO9viaGSdc2HASXMoos4D+VyFER6byBramb4BqzsvSa3RwqA5uQIutvTSh2+2jAouBbJXaOwrG0SA9791BN7IpkApY/efYsiupIG1bVdr31Xaze1k4ht/M/7I++a2IDLD1Hw5UVZInacbz0HF/oeOQiyvIsgA9RwCycFVZFGGP3VMs4zOA== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 4AuPXz52stmFD+r369US94nh2ntYnmBqgsW8fHOS0G5EZ6+Fy1UjCKizosjgVYEDWAj2s+13FCWwNWWUKRGRhqxh79E+Gs1rp+9TpH/yu8GQA/5rJPhDBq2nQMbXHavPIbb7YSYsCYeXfKF2q58zsAnDVu5TFrHTsoYEfQMRs1mq3WLCPGLxb0aWuq4H7IXWD0ZwoLlm2n66SRY42czMi9aB3LAAqxqisM6faWlisYu5NYB1U08bqS0Nk+NCXn276OnAfEUNymQdbH/QirkKA/yC+S+RpHHRdew1h5lDtO/pVZmk8fxGkDYUKPDYJ2/qYFoC3OOf6BkSBURoT7nHT97G72PPDyxloWpprvaZz/KG1zvxuJ4AoP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Source: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2022 16:33:54.4529 (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: AS8P250MB0006 Subject: [FFmpeg-devel] [PATCH 1/5] avcodec/rl2: Remove wrong check 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: ImOgcpU9JdD1 This check is intended to be avoid buffer overflows, yet there are four problems with it: 1. It has an in-built off-by-one error: len == out_end - out is perfectly fine and nothing to worry about. This off-by-one error led to the pixel in the lower-right corner not being set properly for the back frame of the sample from the rl2 FATE-test. This pixel is copied to every frame which is the reason for the update to the reference file of said test. With this patch, the output of the decoder matches the output as captured from the reference decoder* (apart from the fact that said reference somehow lacks the top part of the frame (copied over from the background frame)). 2. Given that the stride of the buffer may be different from the width of the video (despite one pixel taking one byte), there is a second check lateron making the first check redundant (if one returns immediately; a simple break at the second check is not sufficient, because it only exits the inner loop). 3. The check is based around the assumption of the stride being positive (it has this in common with the other check which will be fixed in a future commit). 4. Even after fixing the off-by-one error, the check in question is still triggered by all the non-background frames in the FATE sample as well as by A1100100.RL2. In all these cases, they use len == 255 and val == 128. For videos with background frame this just means "copy from the background frame", which would be done anyway lateron.* Yet for videos without it copying it is necessary to avoid leaving uninitialized parts in the video. *: Available in https://samples.mplayerhq.hu/game-formats/voyeur-rl2/ **: Due to this, the code that copies the rest from the back frame is no longer executed for any of the samples available on the sample server. Given that these are only the files from the demo version of this game, I don't know whether this code is executed for any file in existence or not. Signed-off-by: Andreas Rheinhardt --- libavcodec/rl2.c | 5 +- tests/ref/fate/rl2 | 216 ++++++++++++++++++++++----------------------- 2 files changed, 109 insertions(+), 112 deletions(-) diff --git a/libavcodec/rl2.c b/libavcodec/rl2.c index 5dedb96266..2464ad59ac 100644 --- a/libavcodec/rl2.c +++ b/libavcodec/rl2.c @@ -91,9 +91,6 @@ static void rl2_rle_decode(Rl2Context *s, const uint8_t *in, int size, break; } - if (len >= out_end - out) - break; - if (s->back_frame) val |= 0x80; else @@ -106,7 +103,7 @@ static void rl2_rle_decode(Rl2Context *s, const uint8_t *in, int size, out += stride_adj; line_end += stride; if (len >= out_end - out) - break; + return; } } } diff --git a/tests/ref/fate/rl2 b/tests/ref/fate/rl2 index 9189822503..a3c6a75d05 100644 --- a/tests/ref/fate/rl2 +++ b/tests/ref/fate/rl2 @@ -3,111 +3,111 @@ #codec_id 0: rawvideo #dimensions 0: 320x200 #sar 0: 0/1 -0, 0, 0, 1, 192000, 0x7112a667 -0, 1, 1, 1, 192000, 0x6936abf3 -0, 2, 2, 1, 192000, 0xb1f08981 -0, 3, 3, 1, 192000, 0x4ce7fece -0, 4, 4, 1, 192000, 0xf04decde -0, 5, 5, 1, 192000, 0x47fef74b -0, 6, 6, 1, 192000, 0x99b42ac2 -0, 7, 7, 1, 192000, 0x3c4c419d -0, 8, 8, 1, 192000, 0x66bf5588 -0, 9, 9, 1, 192000, 0xe1de4725 -0, 10, 10, 1, 192000, 0x348b2af9 -0, 11, 11, 1, 192000, 0x1ce73e83 -0, 12, 12, 1, 192000, 0xcdaa6e02 -0, 13, 13, 1, 192000, 0x370dc2ce -0, 14, 14, 1, 192000, 0x1e1e40fe -0, 15, 15, 1, 192000, 0x491470a4 -0, 16, 16, 1, 192000, 0x88c43e9a -0, 17, 17, 1, 192000, 0x036f3f44 -0, 18, 18, 1, 192000, 0xc8be7e25 -0, 19, 19, 1, 192000, 0xbedb397d -0, 20, 20, 1, 192000, 0x97c410f4 -0, 21, 21, 1, 192000, 0xc2c8225d -0, 22, 22, 1, 192000, 0xe396bccb -0, 23, 23, 1, 192000, 0x7e89c24c -0, 24, 24, 1, 192000, 0xb044954c -0, 25, 25, 1, 192000, 0x335890dd -0, 26, 26, 1, 192000, 0x58a457c0 -0, 27, 27, 1, 192000, 0xeb0f4798 -0, 28, 28, 1, 192000, 0x0bfc39a1 -0, 29, 29, 1, 192000, 0x06a6905a -0, 30, 30, 1, 192000, 0x5300c99b -0, 31, 31, 1, 192000, 0x38f3f845 -0, 32, 32, 1, 192000, 0x6afa3543 -0, 33, 33, 1, 192000, 0x5106a8e0 -0, 34, 34, 1, 192000, 0xc76f0dab -0, 35, 35, 1, 192000, 0x8efa6939 -0, 36, 36, 1, 192000, 0x64ea23d7 -0, 37, 37, 1, 192000, 0x421a2817 -0, 38, 38, 1, 192000, 0xc854fa18 -0, 39, 39, 1, 192000, 0x4a10d59c -0, 40, 40, 1, 192000, 0x72637829 -0, 41, 41, 1, 192000, 0xdbbe2796 -0, 42, 42, 1, 192000, 0xff742e6b -0, 43, 43, 1, 192000, 0xf94b9346 -0, 44, 44, 1, 192000, 0xc90ea53c -0, 45, 45, 1, 192000, 0x177483bb -0, 46, 46, 1, 192000, 0x3510369c -0, 47, 47, 1, 192000, 0x501034bf -0, 48, 48, 1, 192000, 0x315c744b -0, 49, 49, 1, 192000, 0xdb5048ae -0, 50, 50, 1, 192000, 0x09a86221 -0, 51, 51, 1, 192000, 0xb9c9568a -0, 52, 52, 1, 192000, 0x5eee665b -0, 53, 53, 1, 192000, 0xdef85517 -0, 54, 54, 1, 192000, 0x7896b5ad -0, 55, 55, 1, 192000, 0x19fbad39 -0, 56, 56, 1, 192000, 0x63358748 -0, 57, 57, 1, 192000, 0xca0196a3 -0, 58, 58, 1, 192000, 0x0b321da3 -0, 59, 59, 1, 192000, 0xa07af07e -0, 60, 60, 1, 192000, 0x21f9310c -0, 61, 61, 1, 192000, 0x62d59874 -0, 62, 62, 1, 192000, 0x021227b4 -0, 63, 63, 1, 192000, 0x01dac0c2 -0, 64, 64, 1, 192000, 0xf3c33a74 -0, 65, 65, 1, 192000, 0xeebe83b7 -0, 66, 66, 1, 192000, 0x9ec77f97 -0, 67, 67, 1, 192000, 0xc91c2e37 -0, 68, 68, 1, 192000, 0x7b58751d -0, 69, 69, 1, 192000, 0xb178dfbb -0, 70, 70, 1, 192000, 0x2a63b5be -0, 71, 71, 1, 192000, 0x44a407ac -0, 72, 72, 1, 192000, 0x9a8e17dd -0, 73, 73, 1, 192000, 0x5546f4c8 -0, 74, 74, 1, 192000, 0xeda94586 -0, 75, 75, 1, 192000, 0x941dfa6b -0, 76, 76, 1, 192000, 0x9772301d -0, 77, 77, 1, 192000, 0x8be16b16 -0, 78, 78, 1, 192000, 0x26dd4496 -0, 79, 79, 1, 192000, 0x27823797 -0, 80, 80, 1, 192000, 0xacc914f7 -0, 81, 81, 1, 192000, 0xcbb72c9b -0, 82, 82, 1, 192000, 0x4bd3391c -0, 83, 83, 1, 192000, 0x4e6adbfe -0, 84, 84, 1, 192000, 0x7a791c75 -0, 85, 85, 1, 192000, 0xc4f59c94 -0, 86, 86, 1, 192000, 0xc4f59c94 -0, 87, 87, 1, 192000, 0x984a4a0b -0, 88, 88, 1, 192000, 0x3353f31f -0, 89, 89, 1, 192000, 0xa9d4dc5a -0, 90, 90, 1, 192000, 0xb33425d0 -0, 91, 91, 1, 192000, 0x546d768a -0, 92, 92, 1, 192000, 0xfefbe5c9 -0, 93, 93, 1, 192000, 0xbd6be61d -0, 94, 94, 1, 192000, 0xf5792731 -0, 95, 95, 1, 192000, 0xccde0582 -0, 96, 96, 1, 192000, 0x857d58ee -0, 97, 97, 1, 192000, 0xe914ce48 -0, 98, 98, 1, 192000, 0x1f736298 -0, 99, 99, 1, 192000, 0xec0b4846 -0, 100, 100, 1, 192000, 0xe1422624 -0, 101, 101, 1, 192000, 0x56e2b0e0 -0, 102, 102, 1, 192000, 0xc4190640 -0, 103, 103, 1, 192000, 0x7c461977 -0, 104, 104, 1, 192000, 0x34b1d5e8 -0, 105, 105, 1, 192000, 0xbdc70f7a -0, 106, 106, 1, 192000, 0xb466cd8d -0, 107, 107, 1, 192000, 0x0e86a04c +0, 0, 0, 1, 192000, 0x7324a772 +0, 1, 1, 1, 192000, 0x6b48acfe +0, 2, 2, 1, 192000, 0xb4028a8c +0, 3, 3, 1, 192000, 0x4ef9ffd9 +0, 4, 4, 1, 192000, 0xf25fede9 +0, 5, 5, 1, 192000, 0x4a10f856 +0, 6, 6, 1, 192000, 0x9bc62bcd +0, 7, 7, 1, 192000, 0x3e5e42a8 +0, 8, 8, 1, 192000, 0x68d15693 +0, 9, 9, 1, 192000, 0xe3f04830 +0, 10, 10, 1, 192000, 0x369d2c04 +0, 11, 11, 1, 192000, 0x1ef93f8e +0, 12, 12, 1, 192000, 0xcfbc6f0d +0, 13, 13, 1, 192000, 0x391fc3d9 +0, 14, 14, 1, 192000, 0x20304209 +0, 15, 15, 1, 192000, 0x4b2671af +0, 16, 16, 1, 192000, 0x8ad63fa5 +0, 17, 17, 1, 192000, 0x0581404f +0, 18, 18, 1, 192000, 0xcad07f30 +0, 19, 19, 1, 192000, 0xc0ed3a88 +0, 20, 20, 1, 192000, 0x99d611ff +0, 21, 21, 1, 192000, 0xc4da2368 +0, 22, 22, 1, 192000, 0xe5a8bdd6 +0, 23, 23, 1, 192000, 0x809bc357 +0, 24, 24, 1, 192000, 0xb2569657 +0, 25, 25, 1, 192000, 0x356a91e8 +0, 26, 26, 1, 192000, 0x5ab658cb +0, 27, 27, 1, 192000, 0xed2148a3 +0, 28, 28, 1, 192000, 0x0e0e3aac +0, 29, 29, 1, 192000, 0x08b89165 +0, 30, 30, 1, 192000, 0x5512caa6 +0, 31, 31, 1, 192000, 0x3b05f950 +0, 32, 32, 1, 192000, 0x6d0c364e +0, 33, 33, 1, 192000, 0x5318a9eb +0, 34, 34, 1, 192000, 0xc9810eb6 +0, 35, 35, 1, 192000, 0x910c6a44 +0, 36, 36, 1, 192000, 0x66fc24e2 +0, 37, 37, 1, 192000, 0x442c2922 +0, 38, 38, 1, 192000, 0xca66fb23 +0, 39, 39, 1, 192000, 0x4c22d6a7 +0, 40, 40, 1, 192000, 0x74757934 +0, 41, 41, 1, 192000, 0xddd028a1 +0, 42, 42, 1, 192000, 0x01952f76 +0, 43, 43, 1, 192000, 0xfb5d9451 +0, 44, 44, 1, 192000, 0xcb20a647 +0, 45, 45, 1, 192000, 0x198684c6 +0, 46, 46, 1, 192000, 0x372237a7 +0, 47, 47, 1, 192000, 0x522235ca +0, 48, 48, 1, 192000, 0x336e7556 +0, 49, 49, 1, 192000, 0xdd6249b9 +0, 50, 50, 1, 192000, 0x0bba632c +0, 51, 51, 1, 192000, 0xbbdb5795 +0, 52, 52, 1, 192000, 0x61006766 +0, 53, 53, 1, 192000, 0xe10a5622 +0, 54, 54, 1, 192000, 0x7aa8b6b8 +0, 55, 55, 1, 192000, 0x1c0dae44 +0, 56, 56, 1, 192000, 0x65478853 +0, 57, 57, 1, 192000, 0xcc1397ae +0, 58, 58, 1, 192000, 0x0d441eae +0, 59, 59, 1, 192000, 0xa28cf189 +0, 60, 60, 1, 192000, 0x240b3217 +0, 61, 61, 1, 192000, 0x64e7997f +0, 62, 62, 1, 192000, 0x042428bf +0, 63, 63, 1, 192000, 0x03ecc1cd +0, 64, 64, 1, 192000, 0xf5d53b7f +0, 65, 65, 1, 192000, 0xf0d084c2 +0, 66, 66, 1, 192000, 0xa0d980a2 +0, 67, 67, 1, 192000, 0xcb2e2f42 +0, 68, 68, 1, 192000, 0x7d6a7628 +0, 69, 69, 1, 192000, 0xb38ae0c6 +0, 70, 70, 1, 192000, 0x2c75b6c9 +0, 71, 71, 1, 192000, 0x46b608b7 +0, 72, 72, 1, 192000, 0x9ca018e8 +0, 73, 73, 1, 192000, 0x5758f5d3 +0, 74, 74, 1, 192000, 0xefbb4691 +0, 75, 75, 1, 192000, 0x962ffb76 +0, 76, 76, 1, 192000, 0x99843128 +0, 77, 77, 1, 192000, 0x8df36c21 +0, 78, 78, 1, 192000, 0x28ef45a1 +0, 79, 79, 1, 192000, 0x299438a2 +0, 80, 80, 1, 192000, 0xaedb1602 +0, 81, 81, 1, 192000, 0xcdc92da6 +0, 82, 82, 1, 192000, 0x4de53a27 +0, 83, 83, 1, 192000, 0x507cdd09 +0, 84, 84, 1, 192000, 0x7c8b1d80 +0, 85, 85, 1, 192000, 0xc7079d9f +0, 86, 86, 1, 192000, 0xc7079d9f +0, 87, 87, 1, 192000, 0x9a5c4b16 +0, 88, 88, 1, 192000, 0x3565f42a +0, 89, 89, 1, 192000, 0xabe6dd65 +0, 90, 90, 1, 192000, 0xb54626db +0, 91, 91, 1, 192000, 0x567f7795 +0, 92, 92, 1, 192000, 0x011ce6d4 +0, 93, 93, 1, 192000, 0xbf7de728 +0, 94, 94, 1, 192000, 0xf78b283c +0, 95, 95, 1, 192000, 0xcef0068d +0, 96, 96, 1, 192000, 0x878f59f9 +0, 97, 97, 1, 192000, 0xeb26cf53 +0, 98, 98, 1, 192000, 0x218563a3 +0, 99, 99, 1, 192000, 0xee1d4951 +0, 100, 100, 1, 192000, 0xe354272f +0, 101, 101, 1, 192000, 0x58f4b1eb +0, 102, 102, 1, 192000, 0xc62b074b +0, 103, 103, 1, 192000, 0x7e581a82 +0, 104, 104, 1, 192000, 0x36c3d6f3 +0, 105, 105, 1, 192000, 0xbfd91085 +0, 106, 106, 1, 192000, 0xb678ce98 +0, 107, 107, 1, 192000, 0x1098a157 From patchwork Wed Sep 28 16:35:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38443 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp357789pzh; Wed, 28 Sep 2022 09:36:03 -0700 (PDT) X-Google-Smtp-Source: AMsMyM65VZdMwR0kEV96lIM6iwnyME2rGve+x5Rh5HK7hv5+wbx6xLcISQHTqsm3GLZRhyq6MSKe X-Received: by 2002:a17:907:2d09:b0:782:7120:7092 with SMTP id gs9-20020a1709072d0900b0078271207092mr27235925ejc.141.1664382963193; Wed, 28 Sep 2022 09:36:03 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id g18-20020a170906869200b00780b0992eafsi4352358ejx.561.2022.09.28.09.36.02; Wed, 28 Sep 2022 09:36:03 -0700 (PDT) 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=ZEzOdEiV; 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 89DE068BBBA; Wed, 28 Sep 2022 19:36:00 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05olkn2033.outbound.protection.outlook.com [40.92.89.33]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C995468BABE for ; Wed, 28 Sep 2022 19:35:54 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eCdtLbfOsExkarS6o2+St/fRebPvF5PbCPz5FY/e/GHlruwVraN00U4RRIqOB0N6uAXsJe3CWrLfYxN0ZN5FOOgvuUzm2UbSJwzejioMlOU73Jcc+nPj/rVK9mRcO3MMzSGTLq3g8CeLn7UQd8Ik3f9KwngJA6AMdhcfJNbdyT8VmZsjMmIFN4wuaCIxf/yYE4Y68U9gsE3CZf1AySUSF0BV9uLIOco/MRFf87y4kCOvv3CIWinA5x1stYDcRapRAA+6AukfdWDekzJoFSgHrMO5SNN5vl8HIG1jRMpRejX2YI/3RKJ226Fa5AEiYWoR62zlug1rTULA317ysEUBEw== 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=FUOyAkPQliWO7HwYNhan7Y5UBUYI29LJVnPj9U9q1yM=; b=Sh0Q06BM7p9VQnf/wP5z1Q+4mvVX2mgejOB4sxYl3q8bxH7i2EdX7nvSYWSKvpWKhwSjGv5vKX3x+MrB3BvRAXAANNECm3haVfRqhrRE7GKizbgLQeWpZBj2sBegiALEQR2IBUuvxm2wrS4gJynkvxL8rhNjaL5yHZPqfPQ0mLIKQpLaYY/upXacpKZfUpGATlM9WoyMSW9wrIOR/iI/XqBnXF3UFZUoIzMCCWKcEBA+KxMUxhIp5VN9hNI6sWUxRgVcwFQS9CndwTVaZvZv5aB4cXZW6FP6+cWAIWDRP4soaDiXAUIzltmRjOa56tUkrZiMdJeVL3F1ENYlgoKvmA== 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=FUOyAkPQliWO7HwYNhan7Y5UBUYI29LJVnPj9U9q1yM=; b=ZEzOdEiVJDR54wND7K6V/s97KtHw2AfoRPM2pe2dhPc2ydR9CMYjMppZ4tNXFm20L4lFKFuHS6sFzKkw8k/5b5CwcJBchKU2YRTUHamOXX3/7QHQaepLGcCvrr0PYW/dEBpsEq8nYGE/wLjukWQMWGh2p9211fGEpbqUrrAoWS7ZF3G7SenvTmUil/tbeAz6XWB0RQ59vtKsmRslghLzs2epnamLNV0NvKez19snq8A0xtl3sUohZ+vhYqPwJRAquPHY3mIiOaP00hVpy+loVhLZIaztAbNMsufqdPO/G19RYsJGCtHLa37ZcmYOxz1cHR6kKxxzfEqJy7oTYtL0BQ== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by AS8P250MB0006.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:359::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.15; Wed, 28 Sep 2022 16:35:52 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8%9]) with mapi id 15.20.5654.025; Wed, 28 Sep 2022 16:35:52 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Wed, 28 Sep 2022 18:35:47 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [TetY/wYFZ1KWIV4CykDBS+DLpBVu+MVyO6Cczc8orZ4=] X-ClientProxiedBy: ZRAP278CA0009.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:10::19) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20220928163550.916073-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|AS8P250MB0006:EE_ X-MS-Office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9DxKqfMd5aiRMduYEiCZVgs4yi0yyPZ404VogH27VM6T/7wBYI3aqrz6ZdQBQc/4Jt5y5keon02yf2Q48DeV72s+hayqqlYIwbRkYlMzfV5Kw4PaUJh+YlpaFTNP4+CFIgb3xqlS22KAoTNh33iUniDqaQHx7R8B4/JJMV6WTt8ZdbagkmYq4jxeHsnjbJUcAZf4vLK3h0M8EyynmV/78myIS9thHL+EkQ6VNh0wHxMhycyM5QeMLWz0Gxd3ityZO5F4w/gjfmLNknh5M/ecuUpWav0MrNwoa/5dvClqGQYZC000gW+Ann4S/Z7GEKfRq7EKWeSoiDqLp6M3k6X4KYW7H4WomyAlHmiWAZhrvPvpA8NJXmBoY9FmBj/lBjrgxKycdhfFuooqCaIjJbpXa6zDu6uc9DnM/3bt3wNqgp7I3MksFVmnf7HtXpw+mgl7o38AOW4sae/eqchHjO3PHZ3iLiqmZtAb4zXnc+T56TY624iXwkx8jGgTM0nPG2RmwFSHlNWaQB1tTonSnwNjDy/R7Z0Vxqu/oKgO1MsOFuTsugAu+EuBUtmogTQ4q6LDWJtxWWW512QSE3vyLF6+qxgEn1/MBYOSF7Oc6EfbGAjITvGVUvQBMVgPiss0lWiAzOAjVtyZ1IKFnVbDNNmJFeHt9Hrx/fyJFCXMg2yJHnABudxyUjScwxBu4ZmA2vIbVBTVIoX2d0sWjndoxs1XN3KjLdTfZ87BPNWFZmCeCktSvyp00LUk54ReKryGkZGLj53FAe7H3GtaY1cf2Qf9GABP0AwlThKXdrecpixfY3olBdIPb8DNa X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 714ecb5e-5b74-4b33-7515-08daa16f820b X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2022 16:35:52.3765 (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: AS8P250MB0006 Subject: [FFmpeg-devel] [PATCH 2/5] avcodec/rl2: Don't presume stride to be > 0 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: 4W6On3/0OOos Signed-off-by: Andreas Rheinhardt --- Lots of fate tests fail if this assumption is not fulfilled. libavcodec/rl2.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libavcodec/rl2.c b/libavcodec/rl2.c index 2464ad59ac..467c4913a4 100644 --- a/libavcodec/rl2.c +++ b/libavcodec/rl2.c @@ -65,7 +65,7 @@ static void rl2_rle_decode(Rl2Context *s, const uint8_t *in, int size, int i; const uint8_t *back_frame = s->back_frame; const uint8_t *in_end = in + size; - const uint8_t *out_end = out + stride * s->avctx->height; + const uint8_t *out_end = out + stride * s->avctx->height - stride_adj; uint8_t *line_end; /** copy start of the background frame */ @@ -100,18 +100,20 @@ static void rl2_rle_decode(Rl2Context *s, const uint8_t *in, int size, *out++ = (val == 0x80) ? *back_frame : val; back_frame++; if (out == line_end) { + if (out == out_end) + return; out += stride_adj; line_end += stride; - if (len >= out_end - out) - return; } } } /** copy the rest from the background frame */ if (s->back_frame) { - while (out < out_end) { + while (1) { memcpy(out, back_frame, line_end - out); + if (line_end == out_end) + break; back_frame += line_end - out; out = line_end + stride_adj; line_end += stride; From patchwork Wed Sep 28 16:35:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38444 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp358023pzh; Wed, 28 Sep 2022 09:36:23 -0700 (PDT) X-Google-Smtp-Source: AMsMyM48UM9StvLPTeBs2Rk2S+5qoBS7h57vrzXlVovvW0+Ggx4dSFZEx+SyOCYBcbMJsTMh2Dt8 X-Received: by 2002:a17:907:d15:b0:781:e347:723 with SMTP id gn21-20020a1709070d1500b00781e3470723mr27693492ejc.723.1664382982772; Wed, 28 Sep 2022 09:36:22 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id g4-20020a170906c18400b00741a0c28f07si4740112ejz.943.2022.09.28.09.36.22; Wed, 28 Sep 2022 09:36:22 -0700 (PDT) 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=DCoPt04C; 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 A771F68BBCB; Wed, 28 Sep 2022 19:36:20 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05olkn2071.outbound.protection.outlook.com [40.92.89.71]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E666468BBB5 for ; Wed, 28 Sep 2022 19:36:13 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h+UZC3jX6Vnh5R97chXtRhFJDqs4zHn+weDcbDJuQDa2wxr9MgjCY7X4XvFyz98IWV8BEBYihuli2ayEzQ2WPvT+4DIqtl7nBICCA5ATaDSjQcnWO1XTt/huef22xyDcdfrZ8dycEdUhzKWOUBBXoMQEdBMZ1LhFeqICxBOW/gYmYUULVu3AOhCoPVJNgtKZsp0zGdPrEz2kDSsjosP80/1dUL7jix77XtpXo/XF8QTDE1snrS/U4w5Zk+4mwLMJSV25PTBLi26Bsxj/T5bwAQBZ/WaOCUF2cjnisjuDd218TrgUFqFmBr2S5S5MS3KoEPP7hYRxz+HUt/zEc9jmQQ== 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=w+AgXtMrQUFzGQM3lhV8VnOqve/sTlvO2mpjF5ZJ4Xc=; b=ltNqBdbeZpmF6zfuK1928nqhbkX9dTas4EAxv6JEUTTN+caRQAwzlZByNbMUgB8PqS6XrwVK5ltk03kHVXZXh9dSnc5Js7Ti5j3jFOQimTWgm2l6ONU73qb+NaLe7795U8YaKC11GjuuBpA773Li0Zq7FyVKt9jsENwSU78ssccstD2Tw8wxQs5AyBXl1RWhBX1t1fhrk7q2zG/8FeWZ8tJXGxTOwzdIQZxCgAXEI/4SvUnaV6QXB7RVBv7v85pVGZxTYlBlSDBvLq0uo+JlMEXi7b1cPordWHEnhQfGAd1rVDLUFLBs/fQrcPw+QBRbpTesAzkMHab40+OD8cb6tw== 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=w+AgXtMrQUFzGQM3lhV8VnOqve/sTlvO2mpjF5ZJ4Xc=; b=DCoPt04CMrDRTNznwy9nHnB5ZAHxSAJ55AtSjC0EHl4XmDuiax8ICSi9YqCFZGAi66cZnGTaEzpklw5blX6A+ghfVLtCsNstEsordWwXxt/fq3p/nk75acEn+DIM/7XUVVdVFopEZmrNuMBKZDeV4+4dfja2x4m46z0eMb17M4SDAQvEfNmLywkOPgISPIaZT3NhWxk65mlLZ5kyMTRLXu9etcm5gBIPPfZhTrjlTBTMpTQod25N6FcQoNQbvfiRci6AESFEBL+UHOaie101QQo2GgvRUG2qXLUG0CyFF4qgRTXxw1qqxW9Hr2+rmzNJClZg0DqtiXIvj8uPi5ux6g== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by AS8P250MB0006.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:359::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.15; Wed, 28 Sep 2022 16:36:12 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8%9]) with mapi id 15.20.5654.025; Wed, 28 Sep 2022 16:36:12 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Wed, 28 Sep 2022 18:35:48 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [fXeSkFa/yhVqksPxOuoyFWVKbdLW4aDAAGoXEsjxtHM=] X-ClientProxiedBy: ZRAP278CA0009.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:10::19) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20220928163550.916073-2-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|AS8P250MB0006:EE_ X-MS-Office365-Filtering-Correlation-Id: 5eac3495-aedf-4374-768e-08daa16f8df8 X-MS-Exchange-SLBlob-MailProps: EgT5Wr3QDKyaZg3Nqsb2Hykb5+EITt3rYuqsTnuF7+HLdb0O9ABzIkksyLhKyekKopkprWa6XP0ExEJOo4OPw8tD2YUU0rZUEMIRg7bLlklGZWLLv//I8GgqF/YzTqRBKt+1FZZFQreiI5RCU6M0ZCCX8OtTkKD/ECzA2v/dwlfuzDF3axVBJxa+RMMfi5toHSscKuFipwiWfgqPOcj4vV4df/67Hd/5YMo1SGjbagEvCnVpkCtQuMWh4CElDiWTcfD4PrLmGItFuH12jd2WtMkeaKvNrvKGOhLgb6zmpjHhoFBOpFsDSF57rO5mC0KrUn5s8D1h9ZM83UrCIBvalrIhx4N2oofNdcCu1iH4phtr+eMNjtBYFjeitRilkqewx0zbvSGZUTRwfagTDL0gFAU33wsb4aMXyOPKiNn3h7YeA6JHmtc6IQXKpIv9TEE6LRPfYgYcIEqNM7Bf3njIlxbhfT4AuMzMHFSKhJis37KJkFGf4jmnmwJ4sMlDlp69K8eRK7DNpn964CmSshDTO1AwhvOiW5UNTgrI4xLS8Odsg0KX00vNX7yJeIffUWeOZa4YDmuUXl82sAdzAgP2IW+u21qz04rlQmQ0ZdlW39gkDm6GvRTwTIPrC+z8cyWyYthE82TZIQpZaySwtBPfKK9e9h7zAQGe0xgO479SrPlZWUEDEI1VetQaJTdUlT6KtwV5KDqE6RTzT/KXUDYih94SpQtCiTbnS51+iSa+wVo= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7dU2vsRJhz0YxoVmaYyrln1sdn1lGZOKSfnSV5cpOhtbIeyJtw1GEj1+aXc5y8I9FLO2/y+yXmcrGVaR4fu5IHZUrdBuLmwYrJ0thsP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Q2eyKQKGtQggqVwpxcNY+WtVfXXJWX2uDo8eXjkfKSaj+/3XP9ISYlwYsz+kZ6/d9Mf0jICTGlrRqK2SgTg4bruC8O4Okylnmd4aBMjoKLxOsyLPvlPFSlKhoPXSureVaGm0murqidMRthVvkaBryZ1y4srl/48NIwU6WhhQ9u4r94NN8R2v1uCEeFyaCMkMOHruo+/xVoHmErwsnqj0OP/8SlnrvNLtfwl5j9bspnkQXGDB5exNIJWF8v3o5OLKnazcJYRpUlP8fzFigDatpeAlokiOOXdhd82XJApmjRSEBS+z79by2WlsWJW2Y0KhVSJ0gm/bOLg1V+2qeq379tRYAe4izdDAw1QrOczDjOZ/bl/sOOC9ZQQi+p0vK4GUYGLi1drQdIS0ARgMzUK5+CWNLfjPcdiRMPAmrWoUanCWIIhO2TiiBRuRg0rr0yrlWTc4zmuVQyM9344OL5sZhjb+SYm8zzcvWBxoM+JcZQUUkF3WMN2bYIXSTzyrU4tVo9rS2TmaKfco3nuTg/G5dx9udBnpJ3omihxWCTQt7PPbISZ+JYJVlGAEe4VAgKK+TvjiiB5mta/m3eQSO+Ss/ModfttTmac2xPj/Hw+U/viv9DbfYhgYT4//Q0NCzU8oeZ6OMxLBQQYuvziJcmg1bF1H+cXIgg0WrMO8bwpXtZe3d4FMvVjehNpKav7lRnCIIFEe7TEhCAmdpq6OfNzLWfkpqmTXtrdqQ4iqI2hP5vGXIGJoBOwa6QJnlldaEmAXJvWHZQmSCFIYF72qG2h+tY5C+0mFfTzDJa15xCnVpIoqoAYl0JERCBr1IzSZpWx4uryk0r17LmbgKBo21nTDvbJLRH3mhE0Ry7vI3puc X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5eac3495-aedf-4374-768e-08daa16f8df8 X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2022 16:36:12.4002 (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: AS8P250MB0006 Subject: [FFmpeg-devel] [PATCH 3/5] avcodec/rl2: Use ptrdiff_t for stride 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: oAzrLrbZobPo Signed-off-by: Andreas Rheinhardt --- libavcodec/rl2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/rl2.c b/libavcodec/rl2.c index 467c4913a4..76982f0426 100644 --- a/libavcodec/rl2.c +++ b/libavcodec/rl2.c @@ -57,11 +57,11 @@ typedef struct Rl2Context { * @param video_base offset of the rle data inside the frame */ static void rl2_rle_decode(Rl2Context *s, const uint8_t *in, int size, - uint8_t *out, int stride, int video_base) + uint8_t *out, ptrdiff_t stride, int video_base) { int base_x = video_base % s->avctx->width; int base_y = video_base / s->avctx->width; - int stride_adj = stride - s->avctx->width; + ptrdiff_t stride_adj = stride - s->avctx->width; int i; const uint8_t *back_frame = s->back_frame; const uint8_t *in_end = in + size; From patchwork Wed Sep 28 16:35:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38446 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp358236pzh; Wed, 28 Sep 2022 09:36:39 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6h0CD/LYJd9jEmWi7eAqOjaHDBmiS+J5AsuzNpsIvCQt5LvEiOaOephZlnLD+MCp4+w0WS X-Received: by 2002:a17:906:4796:b0:787:7693:7942 with SMTP id cw22-20020a170906479600b0078776937942mr6083326ejc.752.1664382999273; Wed, 28 Sep 2022 09:36:39 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id kl13-20020a170907994d00b0077771b6d988si4593434ejc.558.2022.09.28.09.36.38; Wed, 28 Sep 2022 09:36:39 -0700 (PDT) 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=oMZPPrxo; 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 8C86068BBA4; Wed, 28 Sep 2022 19:36:32 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05olkn2014.outbound.protection.outlook.com [40.92.89.14]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A695F68BBC2 for ; Wed, 28 Sep 2022 19:36:25 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A6rERz3iC56dVIK+kcpwJPQZ9zIZydnxb2z+tIqpOn31WlMjrVp+CDnB3p7WFsNwZQRbql8LCS/M8rKfBahhAB2luSs4+aw0UlC3GGWKyZz31961u1x1LYshkMABjr2CYE0W8Q8jGEG7f24CcIjuPB99tembGSZbtOM4NptSQ5dQveojVxm8aDEDc4L3Ug9WKr7qcROIJq6Aj4b3bAtPAWMQCVPmbuOzeoZUrqc+Q944Qj6jTRqm0lRzTw+qBaW2kQwqP/QtwKi7bPnwHEM7dqmYxX81EIQ81onG87eVt0303y9dzmbChqU9rFbp/l0IgC0o7rq+vy+RyVqmtRuDag== 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=LbxS0mHZhYwjRcUGmTq1AjOj62t2rtSLQymRet6/5hs=; b=fFTYqp9zfuFzwg/7YYOzFTmZU8zFOwWVwfWXN7ynPLLzocBjVK8F9jYVcK0JZOa8q/lBiENXC8GM1kSUfZiWYLd8diFs9tD6lnelpx73Cwss/TL4yabt9nmlq0s28KulYNMTFzPJ4ITSYgs+EDhm8HLRWR3c9LT4panGFhZODtxb83Tz11+ju7sjDQACngRJNifS60wPbwobaj7FtQkusJi4/7jgBFPd9f6/fiiPtDBHdT+65MkQOTeMfbBxY0qGh70W3t6kIz6zLkESIGFCkKwpsbHux49W5fv8oOHY2VD/GbcHIgh0mpzNW7E4DhhCF+hyTvGxQiCtdFpN9H4Hig== 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=LbxS0mHZhYwjRcUGmTq1AjOj62t2rtSLQymRet6/5hs=; b=oMZPPrxoh8H9tWBEgHN1Wpykpt+BBILXtlSQo6FsyEglecPoA4hRpds++KrYRmkay+VG4CE/CZ9b8Uz5y6bRmMtIcH1yKFdP6ZRH8ks+fq9THfO9M4q4rLPefKeseAdTY14l+whJ1tlTokM/q4I94FpsrOsN8a+/E/xDgG/nxMMQTJhNzxxY+D65OCRFY+i5JxAXjBVUjaPACXiRD/1kabSQOGnsm7XpLsE6M27RpEAKcHAu1pJjjCM64iJgibjzRF/mKcemCaNakeqHYmt6mGPfy0oc//jvAgV7MU1PmvB/6nsqUf2ldcuvsVarWO+LqaHkm5wbpBgY2x2/AZPhsg== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by AS8P250MB0006.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:359::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.15; Wed, 28 Sep 2022 16:36:15 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8%9]) with mapi id 15.20.5654.025; Wed, 28 Sep 2022 16:36:15 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Wed, 28 Sep 2022 18:35:49 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [hy7z9n5vKDgtSpwbVcQcSxdcUN938lwD3++12lqOE4k=] X-ClientProxiedBy: ZRAP278CA0009.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:10::19) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20220928163550.916073-3-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|AS8P250MB0006:EE_ X-MS-Office365-Filtering-Correlation-Id: 9690e42b-504a-4e8e-f3ef-08daa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/GexldHmEWL4u+C6YD/15tZssKZf69eD2kJq1yfkreXYtDkg6/ro3lAfiRqrp3yLaI/F9r9F7MOBdwaXEWJwN5d+H0HhfzZLZwE2SiTiM4ADGSgtD9wlySr0zJgoWhP35ihOevyinjRvLUWnA7CKCAEOJQrLY9usohHIRd6XGLe2cIuSYlPYEuiRzkUIO7ZhelBMFoyikhCsJbbElE1O2JKVmk3cjUnoIdXyhne5DjwQcWJoThNc0xM0ScYMzdDGp8IL+YBNe14mT0rC/Ut5EZVZ0Vomw+yVcOdgZq6q12ELVA2ZMpgwlbHxkFydoxsdjsruVJXofFYa21M3w+VoI97AGMvzGNKulpzpwbqBlN/vsf7FUJVJAix9LwHvni2saEmUnqtxvsvX4qgIsTjOV4RR52gVKrNYli6HnNZX8j18fMPKZrwGZH1kPCjALLDLWbK7lObkcVzdBP4Ut6c26qT4CGgkymPaEl2FXQoAAJmo8GL8YuzDxqe9dwa/43Js3o7L4mi1zfWoH1ob0w3sPEj2jkZGbLeCu1er3HrcPNjiM2hcUdzHhrV+XHRbv5xkNfKF+hmEGMwp4U/ueYTrdIUaCvj+N5jIRxDYaC/L0I0cpRsMJ5fISRPWsDnET8lyyS8wnftHzqUGiBLJsnnpGpcHZhS5ZaVtL4fDE0UTXx0dLSGg/8d+QVs9HV0pjQQA55FwN1zicG9/kALBC5t8lMOH69skvPg8K+Z3ccVPwf2cIaC X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9690e42b-504a-4e8e-f3ef-08daa16f8fcb X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2022 16:36:15.4171 (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: AS8P250MB0006 Subject: [FFmpeg-devel] [PATCH 4/5] avcodec/rl2: Fix undefined pointer arithmetic 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: /2D8DF7xoPA2 Don't increment back_frame if it does not correspond to a real buffer. To do this, handle copying from the back frame separately from the "use coded value" codepath; also use memcpy for the former, as the chunks here are typically worth it. Signed-off-by: Andreas Rheinhardt --- libavcodec/rl2.c | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/libavcodec/rl2.c b/libavcodec/rl2.c index 76982f0426..7938ef1d92 100644 --- a/libavcodec/rl2.c +++ b/libavcodec/rl2.c @@ -69,13 +69,16 @@ static void rl2_rle_decode(Rl2Context *s, const uint8_t *in, int size, uint8_t *line_end; /** copy start of the background frame */ + if (s->back_frame) { for (i = 0; i <= base_y; i++) { - if (s->back_frame) memcpy(out, back_frame, s->avctx->width); out += stride; back_frame += s->avctx->width; } back_frame += base_x - s->avctx->width; + } else { + out += stride * (base_y + 1); + } line_end = out - stride_adj; out += base_x - stride; @@ -89,16 +92,32 @@ static void rl2_rle_decode(Rl2Context *s, const uint8_t *in, int size, len = *in++; if (!len) break; + val &= 0x7F; } - if (s->back_frame) + if (back_frame) { + if (!val) { + do { + size_t copy = FFMIN(line_end - out, len); + memcpy(out, back_frame, copy); + out += copy; + back_frame += copy; + len -= copy; + if (out == line_end) { + if (out == out_end) + return; + out += stride_adj; + line_end += stride; + } + } while (len > 0); + continue; + } + back_frame += len; val |= 0x80; - else - val &= ~0x80; + } while (len--) { - *out++ = (val == 0x80) ? *back_frame : val; - back_frame++; + *out++ = val; if (out == line_end) { if (out == out_end) return; @@ -164,7 +183,9 @@ static av_cold int rl2_decode_init(AVCodecContext *avctx) back_size = avctx->extradata_size - EXTRADATA1_SIZE; if (back_size > 0) { - uint8_t *back_frame = av_mallocz(avctx->width*avctx->height); + /* The 254 are padding to ensure that pointer arithmetic stays within + * the buffer. */ + uint8_t *back_frame = av_mallocz(avctx->width * avctx->height + 254); if (!back_frame) return AVERROR(ENOMEM); rl2_rle_decode(s, avctx->extradata + EXTRADATA1_SIZE, back_size, From patchwork Wed Sep 28 16:35:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38445 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp358129pzh; Wed, 28 Sep 2022 09:36:30 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6BuSJLzFWo0MRpWqcPtKscvnZPsNDD1ILqsolQeqReRhBvbYiLp8DSWQxCzFPXCGHPhHss X-Received: by 2002:a17:907:1dcc:b0:77a:c5f3:708b with SMTP id og12-20020a1709071dcc00b0077ac5f3708bmr28434199ejc.331.1664382990525; Wed, 28 Sep 2022 09:36:30 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id r13-20020a50aacd000000b0044f00017470si4908047edc.634.2022.09.28.09.36.30; Wed, 28 Sep 2022 09:36:30 -0700 (PDT) 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=kX3oM5oH; 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 931A568BBD9; Wed, 28 Sep 2022 19:36:26 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05olkn2014.outbound.protection.outlook.com [40.92.89.14]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3E60B68BBB5 for ; Wed, 28 Sep 2022 19:36:20 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KzgZAzJ3buOaHkypZh6BuQOVnNSdK8FDuxS2F7gQP3V/K4ay4xXbS84HqqHzOon2Va09OmMfIwCOPlql449C2fD/OaLOi2Ad7qJkjJ6uTBmitRFW+zyw0FQhRsChm5l7FQdxUUV8mEdi5B6TxffkqzklgV69L35LDguDtS81C4SC1nVr8GuK4328D4wzak0Mnonz2zYGLyOTmDImK0jGSHiJBmEJtvc981TaRTTSEXmsaKb5egxY8N7NMNvzWZmL82oi5yWCRhXhZAHch3enQmTIoMdPj7rZrS8sySTl05mPGZg7Js5PqWwAiQS/vDeXfql45KKn8WFI02fWmYQkTA== 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=9MDadMv1BUFxyGoz+a/32L/uRVPnzRriW9p5jcTGW98=; b=eR76wc0o6lUfJg6mb3r8sIjArx7UCqeVHIjC8jxx5FdSWc8p9olU7RORg6RkHtvni0O7lcZibFFMPUms0Qh4w1eTWsFO3eM2zOEZUvtSWuzVt+E0dFVSx3lBLMcodfpKa6v1tagE4ROtw/dclij4fXGgpU3Nkz8X3I4scxRfr8RhF0kHVHOzbiMBwJjeVMXHzXPLucYfC7u1gmhDSo6jpbfO+uEYFhx3tYsY/BYJIGD6Y8atV4Rd3s0vRzkS5KllslDGC0UVY12DpXa48DABAu3AlleAcMdnlQO1Rsps80NbP0IVCaZs9lYdg9K2T872Mqt/5E9S2ri46XtC+e5giw== 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=9MDadMv1BUFxyGoz+a/32L/uRVPnzRriW9p5jcTGW98=; b=kX3oM5oHokdo07VVmhJttofkHzo62G2reWD5yOvUfJC0Nzg7ETDvKdM/bPTlkED5/1gUb0J/AAYlr1dJl4X3yr2xfBPza8khRq+mUD6S4z18x22DakG+bq1OPDndgMUqqPgf5Tur2cPNOazph2dT2Bjc61zhOcpIsVLVAXc+5x3I+lbifHCHSleaUgKowfAluR0BejXPIz8mdhch4ZvbUtwYEQrDLNoKwr5ktcOJaZPIglEYWXfg6I5GuB4gdD6dZw1rLq7Mke1Xm/LbFtMj9Ou4FNf/UlirOOGbAf3Eq2Blm1prhn1KKrsv6RIMeAaowvrIsn5ppJoZAYzZDXgOiQ== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by AS8P250MB0006.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:359::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.15; Wed, 28 Sep 2022 16:36:16 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8%9]) with mapi id 15.20.5654.025; Wed, 28 Sep 2022 16:36:16 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Wed, 28 Sep 2022 18:35:50 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [etIG751VfEiBsTVvOPXjWza5FyDu3UrEJSw3I/C+ins=] X-ClientProxiedBy: ZRAP278CA0009.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:10::19) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20220928163550.916073-4-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|AS8P250MB0006:EE_ X-MS-Office365-Filtering-Correlation-Id: 5b5ae534-4cca-4a17-2341-08daa16f9099 X-MS-Exchange-SLBlob-MailProps: EgT5Wr3QDKyaZg3Nqsb2Hykb5+EITt3rfGZ8I10FlYg4NzdvC6Gwlow3L0B8vcefPu+8JZO74rHMSL19T0vQo5HnPqDR7P0C5yGbC6UEpQdkbA7NvT3mccvitzyDPehaKPhB1Pe9sLvJeU4zsAe2qscOl/a6tg3P2QCNajnA/8EAoqcDfRF4yFajztVfNUJCHqPBlP3VSAedHxhGgm9NbUs15vS2YdBpltGSeCphBWL5nNGTL4LdMS9UGcLpgFFy8yxjXcTpD4YWAxE+6HjDspwbREVMzVWKb7G3nJo92wSzVo5lMUAVKFciT9YtxDY50YRS6HGHbCOdF1XEvON+n1VwSS8od6FY+G/HN7OOTGI0IJn4UvdVqTd1WRbAulomHY6xkOdzEGV9Zk8fknt0bbsT28DLyVusGJdNwWpoVvTT1LU/fbAHAnVXxllUuLxPf/CxfaET3C/hHc+B7IXh379v4NamSHi3sAO+UFkZ/RuGbP6TETgq/9JKxkwl9GR+pIODt3vC0XSxqW6Gcmv71LkGx7xj7KWTzQkg1V8VUfripyr3k6QsbDDnIqanYyk2HWGmwY7oNFiQrolqhTEEOln1sQow7Y64ry1cZd01hk5jG7z5KO3mlU6pdZGWxS226qH3fxwNJTBAuPeTRu1gd7g24izySu9XT7m6nW81+3NTeZbXSVqISvaGLSviHHcMh0DBAh21C7NWaZkrgUkgScfCMbAJg1+1h+wyMgv5Sgo= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ITZBCqgxg/8FMmFNgCmvxXFn4mw7VtV5+7uUX5OsBzsftOE3WK2Upnthnbd1VzMohRXPPFxrz6VSontAyHAk/UkbFC+C6hQqXdIHm0tdlqY8GoBg/gELewpqArYJD76+5WM13BQgwBJTYR64gfpC5QJyK2rfK5jI7cfr17OcYQ0GPrdlg9CENaWYFJ1UAgQhHaI44nrr5b7oJsTKS/E+5qlNRQKNPHurjsuJJJXvvKhj45qdQ7NK3HH1Z8kViEMVQsCGb1/G3Yc2zLn/ZP13w5irVIKzki7YJ3bgjfdeHIGseUwUEtJDHWZHFB+Ez476sqWtS6GC0NMZ0vNptHcjd7BkHrxJMugVN2R7XCcPqqf/1+EkUsgkC8K5q2IOlpB+kZQTWy8o/BbTHf4bCd6ODol1guvdbWZSNG9MsTZ937+glHdhYYjuTGMwghuJU/d8tbr6JsYH2jEDI5XTYKpRTIPsKEcJfitlKB/JIPpJFL9Qrr9wG5BZk0RrKkiz3M0bjXQe8o2i+fU/P+0pAs2BNXlwj7rPOh9lyDBkOWVKvbnH1WXFkMGLBKj8Nm+qwT/MJF3EOjOkcuNVsVxUc0FZXpueUbdE9J7Fwi2mzugLROvIctQoEmqrlq6dndQGjwHnaJbCS+yiylzI9PhnoCJGFg== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: qCxO5rHjiR1ZHcEEPqtwWs53OXt7abEdIUTWveNeiJMGiZn0Ghsro/ikVSi1EhzFGz0Zab2gzk6saEXGLqZr57i3bRSNx/KMvbOib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rww98wlmF3X1bu6tixhM7CWfmIMJ7WqaNgcooI8wHvNWXTlTDAqQbefYkrevUFTs5772SPG+ijXu4dl6FoBnLcVtaaqsM8eFsww8g85g/5GjQ4EFzyS959fRK2DXUeAF/dqV66p2blvZam8c42OzUG/npefD8SZUKetR X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5b5ae534-4cca-4a17-2341-08daa16f9099 X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2022 16:36:16.7773 (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: AS8P250MB0006 Subject: [FFmpeg-devel] [PATCH 5/5] avcodec/rl2: Fix indentation 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: IUHt8U15KIjW Signed-off-by: Andreas Rheinhardt --- libavcodec/rl2.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/libavcodec/rl2.c b/libavcodec/rl2.c index 7938ef1d92..e427a27dce 100644 --- a/libavcodec/rl2.c +++ b/libavcodec/rl2.c @@ -62,7 +62,6 @@ static void rl2_rle_decode(Rl2Context *s, const uint8_t *in, int size, int base_x = video_base % s->avctx->width; int base_y = video_base / s->avctx->width; ptrdiff_t stride_adj = stride - s->avctx->width; - int i; const uint8_t *back_frame = s->back_frame; const uint8_t *in_end = in + size; const uint8_t *out_end = out + stride * s->avctx->height - stride_adj; @@ -70,12 +69,12 @@ static void rl2_rle_decode(Rl2Context *s, const uint8_t *in, int size, /** copy start of the background frame */ if (s->back_frame) { - for (i = 0; i <= base_y; i++) { + for (int i = 0; i <= base_y; i++) { memcpy(out, back_frame, s->avctx->width); - out += stride; - back_frame += s->avctx->width; - } - back_frame += base_x - s->avctx->width; + out += stride; + back_frame += s->avctx->width; + } + back_frame += base_x - s->avctx->width; } else { out += stride * (base_y + 1); } @@ -121,8 +120,8 @@ static void rl2_rle_decode(Rl2Context *s, const uint8_t *in, int size, if (out == line_end) { if (out == out_end) return; - out += stride_adj; - line_end += stride; + out += stride_adj; + line_end += stride; } } }