From patchwork Fri Nov 25 13:33:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 39439 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:999a:b0:a4:2148:650a with SMTP id ve26csp5360322pzb; Fri, 25 Nov 2022 05:33:46 -0800 (PST) X-Google-Smtp-Source: AA0mqf4IeVaT6HGVwyHMyPLwPjZfD95pbkJGBwxsA1mgkY1BPWZ8+0XzbmoB0AW34p2T2qB0PCAM X-Received: by 2002:a17:906:32c7:b0:7ad:934f:abc2 with SMTP id k7-20020a17090632c700b007ad934fabc2mr11803440ejk.690.1669383225970; Fri, 25 Nov 2022 05:33:45 -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 n27-20020a170906689b00b0073dcb2ec4d2si2491915ejr.889.2022.11.25.05.33.22; Fri, 25 Nov 2022 05:33:45 -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=pG0TyiT8; 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 697A768BBE0; Fri, 25 Nov 2022 15:33:19 +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-oln040092075056.outbound.protection.outlook.com [40.92.75.56]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8AD1268BB0D for ; Fri, 25 Nov 2022 15:33:13 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KBAVjWHiUeFPxqxtRz0EidDtO/lwUdWvWWFyst3uSaHtYWQJMRUbmTql13/9yUCgsG8N8OfdpjjSLuJn08SUtMXcZNMe4u3yqPBZ0L8HRQpjzf20919UtzGMh6AOYsUDnU6Jag7y9N1fdZu3IQk+c6C5q5JQcCzxuFBEvqEzC9aXRboN+vWNEb+yigsjiklmpeuIz9AFUYSWrcI26CckCczN7m6Q0z8G+241S7+T231dRGI3tteUeYCfLMvt1ei+6HkoHJfKyYL56ENzU6jBCrTO1Q3kEwg36pzVecElbS+I0jwVXEYt2KCYNy8hFD33AzsguU6oKgOGuN1R3vBH/Q== 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=Rdzbmc+fpqbze25ip+Vaahsl+33AyU+yciJFp8er6CY=; b=XlO4KsFCb2t4OoMqgrgqoD8dBStBcKCnb1S9Jc69UgdG679TrGVKoCPCH+rY0HBOrj8oT+iGNAjMK1YgsxbFmThm/Mz7dn4m2YpmE3cIAjMYDJZg20PFRmEIl7GVqkHDCnmqlhK/FhGysCx5wYbVOK+HJoQsGyXw/I88yx+wXK05FrpNtXZVOIuJnD0pGe/NOrxQj/wh2igquk153pYFa6fqphfodfMcWo3nOTYsBiCzP/kSyy9ANQISzJas2eD4BUpEj5A9LUzEK4YAHzi9h1n9Lt0r614CqsUwthS4ZtepdZKrLYqgl7ybfyZ84XyGunkru+FjMsGeDiXAvMYYnQ== 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=Rdzbmc+fpqbze25ip+Vaahsl+33AyU+yciJFp8er6CY=; b=pG0TyiT8LfjCwUJu223UCnfHlMeVPK21n/QjJAo2G3oWnnS86FVUI9lF3pBtwnWib3pyytyPFHUN/suRAg6xGWSkEL3uviPZCvytGWRhKdwNxWGj0iVPmXXqAQztPMSr773Ct8LRJHBB6/R/E8/AaLSp6lSspvYTEkY6Un2WKzWwDwNR4My1/h/gqTCmcPg4bVL47gNXerLDTppVmRIU9x+X87IWSW0uNOv5ui6jvznS0MT5Hv2XKVpIYFoNz+ZDpdvWviB4XQzkoG6Hb1CNRgVxJWOvWvmFCqTr9P8FqshXipptQtwoVLK0Ft4ry60lhQb91xGM9GIh3MHJbzxB5w== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by DU0P250MB1044.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:427::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5834.9; Fri, 25 Nov 2022 13:33:12 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::c37:cabe:316a:60b2]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::c37:cabe:316a:60b2%4]) with mapi id 15.20.5834.015; Fri, 25 Nov 2022 13:33:12 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 25 Nov 2022 14:33:23 +0100 Message-ID: X-Mailer: git-send-email 2.34.1 X-TMN: [5+lxwSy58+Svwd/iR5t3kBcFh6QtBncTqnyCB8Rkae0=] X-ClientProxiedBy: FR0P281CA0147.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:96::11) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20221125133323.1076807-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|DU0P250MB1044:EE_ X-MS-Office365-Filtering-Correlation-Id: 80e7ff7f-62bb-4260-8e4f-08dacee99802 X-MS-Exchange-SLBlob-MailProps: EgT5Wr3QDKy65eRJXb6jJzCG1oKNfUjb18BGmpoG/ARwllNLHyTon99d1GXAkQVl4nhR8se3hB6gTJ0WbhrAh0X1MOp6T7mS/rOLvvw6PNVHXxHCQJfg6UGi52MJ2vs6fe2MZtkQocsRA1qGGJmM9uD/8mlUNVHNGrSNw/pg5NPBt7FPduqcI2nUrpZehAww9+/2LFjRZ7f5AiChlzwbSPtvjYv57nEmdieZo7SZxN1qV6sstgBURC28iCCMbWVZrRbPJLSQYdTZxnFoCDlRJKgpM+JUnAXioaeqkC8LEdB3v7v5FBgXpC0Ai4iWvNYMGtpTRGOOVpkVBbFhg+Z0qNxmUiwB5BdYupqaBaDCMFfvGeQnUToqXXhd7DsO0tGLC4HcAZ9iwglNW2R4M5//j79C0/AJuouRuZNOK0nfMcQ7ofT7tuKSxBETKDUDtp0RyaoPzHQdvwR6Lm3g/LbDLMxXxIcXcZ486AtohDhZTaDfla1vVIwAFeZ6BprTWkIRgTxt3gl9ToDKrerw0tY3PZddAHYyFUTsrxeKA97G1vmKCDNH4cs7xasYorzjLJsVvLhWxrggqc5OoYLu66/EE5aLUlhnVFK5d9U+xgrp3K4RnsKuMvyO49ELbpcuX4UcZ4h72kwT/cOcBZ1YLVH1bgeQtz8pd/RAdrHHbG+XV3eedRxeGJ8Y93r0ehP803Lqm5NYGvlm1Di9porQGTuHiSfEjUOye1Y0zbvBo7SeHBk= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2mVXnQviIVOTbkSWjYW2VDAHr00jpNwteK9rbTx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PFGyJBgzYMhexgaQv3DxRnx+OIlC1jx+1rVAUB8HY+sVs9H27J3jtsv3+/EBIE0tMrhvMsYdQTzRel2jM0tK1ouUwvfP6PW74YVrUR4h3etEORK2nbvD01S/I2eGQibtt1d+MGbcDNREy7wK32WZpCKw32aID+XVo9qoHEdLalBkC9W2w8qWVLDfd6JzfpxANE5j47v0pK1+XztAofq+UTPoqE4ZtIhvBEMuTzh/44iMFP3Iah7FOlG6QKz+jBbR3nE3F+p6HMaiBjMHi3xgjFqEfvA0yQhK0Fxb1dC0zAIIMHRVZdT4rOQQeHJG7AYNmslyWTe0g9za+Aztlo1Yb5L2Sx4j+ujatJwg0MhuljMY6UXx5saUhon+oMsic/wgXNp6saxCMXl62SX+EATTCawXSWhZCHkfWlxveQEuXF8j8fAjeaxSoCAUc6V8h/nQ3pUpzUO77gqswiTle3XdUy4n3sC7Ci975a/j0SoIylsA5g3oxf7OWqDKEdrSs6Q966jPXtsYTOZM8whE9TaYwJ48NTlMCwr4nCYQoAF84d3rCDpaF7UeqHW1M/YxnqjPSt9lnJC2QHWSOLuRnkt1k4FomQNpHuEbOJwXBuRLXGRFYXekxObe/owjUZB6j1lmr8tyFW32kRoipkr6YVrrbd/f850OeoJk6BmHl23PBk12EyieqOcqojbBRukuunlszQRyOiSnfH1nDXnC2UYMjFTXyeHEqbwzoGte6Y7LncMPTA15FnUqIUF4EcYWQnw1krP+eUBgvIHVrx6u8BgD8IciX9ku2/CSa1T+BIRAZZ7AGlNJYADgeNdPfu1Dbp6d28d1MGNjhsK7jQ3SE5i4eJb7th3omCDh26bAhE9mQHoPSNpdkAfEGB/7JyJK9jrCjrwGjVjJG5vPM+cgna7dXgERL6/tNHuV/ZFg48uveDogcAIBtqKYjApYGGT5C9v/EunjSD9Vn X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 80e7ff7f-62bb-4260-8e4f-08dacee99802 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Nov 2022 13:33:12.0611 (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: DU0P250MB1044 Subject: [FFmpeg-devel] [PATCH] avcodec/pngdec: Mark damaged frames as finished 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: a1g5+LJjDtRj Fixes the deadlock reported in ticket #10071. Signed-off-by: Andreas Rheinhardt --- libavcodec/pngdec.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 8080094d65..f1cad26c52 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -1362,8 +1362,10 @@ exit_loop: return 0; } - if (percent_missing(s) > avctx->discard_damaged_percentage) - return AVERROR_INVALIDDATA; + if (percent_missing(s) > avctx->discard_damaged_percentage) { + ret = AVERROR_INVALIDDATA; + goto fail; + } if (s->bits_per_pixel <= 4) handle_small_bpp(s, p);