From patchwork Wed Dec 7 19:00:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 39648 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:999a:b0:a4:2148:650a with SMTP id ve26csp871760pzb; Wed, 7 Dec 2022 11:00:34 -0800 (PST) X-Google-Smtp-Source: AA0mqf48/R7k95VUUW4nnpMTM6gwQVGV2PTKm/Js9XZ+hVZSDxtPiHRLkHkHJ1WTuTUwP1HQb30o X-Received: by 2002:a05:6402:2912:b0:46a:c132:8a25 with SMTP id ee18-20020a056402291200b0046ac1328a25mr50425339edb.205.1670439634656; Wed, 07 Dec 2022 11:00:34 -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 bb6-20020a1709070a0600b007baa6e2275asi17516431ejc.236.2022.12.07.11.00.33; Wed, 07 Dec 2022 11:00:34 -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=Qn3VD7bj; 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 B06646801A2; Wed, 7 Dec 2022 21:00:29 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03olkn2036.outbound.protection.outlook.com [40.92.59.36]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7CA1B689D06 for ; Wed, 7 Dec 2022 21:00:22 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W7nkM3WzPh+UFbUgFo2KJASo1pYjx1+tJQwJgNBAjK7aBpoGFOHgmqNeOal9US0Y6A9rXrZHTgXZyj6jDo3Aj2C4+/q9rOygoW5fSqberxkLP0U1ZCvQOBnl2gEG+b+Ze6haoLtGF1bx6o327bz4+K+OsQlqX2YFMooNZDomQ+KfFa2h68xqt50t3cUzVLp4GwvrdlAcPu/E+OKO8mObBfxu0BOcswiAhhAACmeRMrv1bSM3z7eF9ZFyyQM6zxUBwp5m1EVmOEeNvocF287y3Z0n38de9N3Aj6K4N871zLhrLFhC0WxSFXXEbPKGQiKw2H1EXb+IUKXP0pSPSSQB5Q== 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=aoohGYLjBz5vjPPrHTaww8K9bpWphIc0xnxpOGV0aA8=; b=Lzm/pJZ7W5NDBu3GtKAw9sVHwpXr1aAI+pyGb5D3eh3ldFQNgISuhf5nE5eDitDGOr30vKNOQ2fdaHMjTvHjz5Ck08o9X54tJj84ZRtBPtd0rtDGDUmy8o0ZzYcwc39phd4KXPY9U3bclXQeFVzRkD0b5lGoRD772HcLMhUUuKMJi9/MBt/yMBb2XhGfu6214eCCUi+NHo6CrfVJxZBJSE7w1ClNGib9abs9VVGnknVuPxJDD0e+K/eigetsLFEbEIgH47ugcyfnXfO9T8XdWkYmY/ydckVM1wbfCitBX+v7lhZ99RtpDH+gE7pTMt0Vquw8jIpu1ASatZoAmcpDUg== 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=aoohGYLjBz5vjPPrHTaww8K9bpWphIc0xnxpOGV0aA8=; b=Qn3VD7bjXhF6L70gfj8LkzTSYPGY2Zy45BmIFaK3J0EvTH/COtPauFjk5Q4PoY3ZF+gHVViWrRdvss0lMITjOKznntoPhPEfH2fhkM2BgGkas3IkAaUT+Kk9WZwJ3oeBR5TnfQPZbpwtoiiS2kglvJmAEy8pYyolzXkI5Ul7g6jOJk1kGkmkbNLSJt+6KdU8NGgjNJppF94v2gE7GdDLR7j7qymPRGkaAyqzmQReioleeN8Vr7PENXUC/gAZI36SuO11Y+Afx5pTmvVswXQM1sNRsi8Iz823PTz3AyFO0Xl5GF4N2ccVneq6lDSB/IZfVpXgoWb1XpoPYi4oVovQqg== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by AS4P250MB0462.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:4b1::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.14; Wed, 7 Dec 2022 19:00:21 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::da14:61e3:630a:70b5]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::da14:61e3:630a:70b5%6]) with mapi id 15.20.5880.014; Wed, 7 Dec 2022 19:00:20 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Wed, 7 Dec 2022 20:00:30 +0100 Message-ID: X-Mailer: git-send-email 2.34.1 X-TMN: [KzqFmq/znzX1Q8utnunMSPgtWH5zEgG5] X-ClientProxiedBy: ZR0P278CA0129.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:40::8) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20221207190034.1724795-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|AS4P250MB0462:EE_ X-MS-Office365-Filtering-Correlation-Id: ee050466-57ae-4087-da92-08dad88549b7 X-MS-Exchange-SLBlob-MailProps: znQPCv1HvwUpPkvdKOVt0r5Ud+YQpzGbpKbd/goBnsgf1kWeKNVnGPDFKejJJCHRtbtUTHD4QECx4N3/qfVK/djv7TI2z3eHx0fnkYLmdCIWIY6S9iz9kn0s3gYmCBeDcFeEeS304JRFkjsdvWpNeEetct4Oe6b6xXQULVLCwC1kBbNafcUuvL/ov42C8GJLoEPKooRd3hL7P0oqP7NvaNsKX4YBhQdQhtyHGQLMO8n3JR6OPgIxFijxa236VJhpLkCSQjs33Xg8JikouDeN/2Ro6yD6cKSBjHTOatsM1Sm44GwKwop5pXYxl9vFtDDDeqaZvxiFD0Kv8Q9e+SDJWOfWTxSYFY5X6xrJs8kwH879lzsggnt1tkmpLPXVnJvcJ1qSxCoW7AmJeKcGxzHiBP3sh6OCwnX810JHg2tJjZAgC9WFU5IOBY0vWFbrBg7lyDkFH6q4oox9cpqfw6cJH4nplCX2roITQZ+bhoPU/ugLmOoLaSZ7CnYEMdaKzFsxpF1O+XmbE5t4RDlmeiOMffMDZD1dWBJkwxnHNpO3uXlJIWs58NRFhLEE31PXObaXU8zHDnD1xJrXcfv0mnqI+QKyp+GRj1En03XMn9SvRLclFijEx2z7cS9M8NS+K7U0RdSoj36DKPDrVgJFZH/515RiDbHUCh49xT4C2arPxAMI2OrZb/3uPpeILpkRnKMheyITaPWZSTqB0AKhgtxM0fmYabB0op3znqAHy6ReAZ90P/hIwLlj5r9HsCk77yY4k3CTLJGGu5Q= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: W43/A85BdFrAFC2TC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zsLocQylJ8MxyDe939cxogsrFIlve+USBJRWQmlpT4Md4FDt01ZjEmnrHCMhyQL7NqcB6LCNv9V9JaCdg0YA+1QdR/KNDnC28TDRZR2aZRAxP5hvwt4fl20UPE/7CNh35fW1E9IpBf4YqwOatA4o4A6vH0vka5fgtSYV47xpaXZcTfJxgGXGrSHBq8sHAu9GO4AzmcXMNVZTWewWvSuxsHljClluhUmzkEARx9z0Le8Y4Q8yNoKkOen0yHgxBG3oU6g7/s9WUXMnbjEmzt8amOsoRnUq6PPEWxk2j740E032qdNnl6SasU5SF/abKfaA8g6RawSLn1a5kX9pAagf3BwU797psR8NS994lL6ZVQxradZUttznwuS5OF8xWZt8RTvOWGXktpbLMrdj/ZyFfRJ8pCMDdLlrX4RtrghwdSp8VfvFQHsBi274duEDu/4CqluunjJ7z2viQ8hnpYn1EpYOKXrTHEfQH7iwjRZSu48jpH2L27nwQ9f/sW/P1BQCuKc3NK3yHGGXNV3fbOnhwErlkxkaLkTbQvHYUN5kLbGnOj3Gekyo6EqhuC1MksoQXLgam9qo5JYn/4tMyHr+IF6nOl6wkJHXiSDxdpdQj1mgtnw/hfrbGq3J/jjqoM1DWI4eovpC09Nh4jD61D5jN8MbdIpHyKnKkgcSbgxYsN6+O6iI/FluQs1NcKYu6uw6+2AZ4VUWKJKY7g3MRHQe9Qv89M5Ckee7KQlFfOyZpt8VEcR8sA02N8vi/21zY9b953Zpo4v50G2eH3W9wUqE93raY1c7bWVPTY3/Tux6Z4ZigazrrF2QtJvvRy4VyS7Oj9r6tfyT/A9ZtLrJzvY9PrL2fy5SE4WQaj8d0xD2KnmLLNz6e5eik0vYFFCTV0ce9kUXqePGTd5+twnkcRLe5TSWLIskrNFAEzk1AIDIfs8XJ4zZxp6K8PPMkqKOi1JCcOzY2GKxA= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ee050466-57ae-4087-da92-08dad88549b7 X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2022 19:00:20.8988 (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: AS4P250MB0462 Subject: [FFmpeg-devel] [PATCH 1/5] avcodec/mjpegdec: Restrict AVID MJPEG to non-SMVJPEG 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: 0ZGxfurzvUsW AVID content is not supposed to be SMVJPEG; given that both these codecs involve manipulating image dimensions and cropping dimensions, it makes sense to restrict the AVID codepaths to non-SMVJPEG codecs in order not to have to think about what if SMVJPEG happens to have a codec tag indicating AVID. Signed-off-by: Andreas Rheinhardt --- libavcodec/mjpegdec.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 9b7465abe7..28e2839072 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -452,7 +452,8 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s) if (ret < 0) return ret; - if ((s->avctx->codec_tag == MKTAG('A', 'V', 'R', 'n') || + if (s->avctx->codec_id != AV_CODEC_ID_SMVJPEG && + (s->avctx->codec_tag == MKTAG('A', 'V', 'R', 'n') || s->avctx->codec_tag == MKTAG('A', 'V', 'D', 'J')) && s->orig_height < height) s->avctx->height = AV_CEIL_RSHIFT(s->orig_height, s->avctx->lowres); @@ -2927,7 +2928,8 @@ the_end: return ret; } } - if ((avctx->codec_tag == MKTAG('A', 'V', 'R', 'n') || + if (avctx->codec_id != AV_CODEC_ID_SMVJPEG && + (avctx->codec_tag == MKTAG('A', 'V', 'R', 'n') || avctx->codec_tag == MKTAG('A', 'V', 'D', 'J')) && avctx->coded_height > s->orig_height) { frame->height = AV_CEIL_RSHIFT(avctx->coded_height, avctx->lowres);