Message ID | AS8P250MB07443BBA100D818B6D4B83448F089@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM |
---|---|
State | Accepted |
Commit | 715bf3509a96ee679449c0ba479b500fa646c217 |
Headers | show
Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:999a:b0:a4:2148:650a with SMTP id ve26csp772257pzb; Fri, 18 Nov 2022 18:57:34 -0800 (PST) X-Google-Smtp-Source: AA0mqf6dezMYITtOuN9AEkOKP2QyWYosEb83YMXUi6EA2FQRrx7LokZnMbBZJH4VYr2QNasR6q28 X-Received: by 2002:a17:906:3fd0:b0:7af:9bff:8de6 with SMTP id k16-20020a1709063fd000b007af9bff8de6mr7726985ejj.91.1668826654035; Fri, 18 Nov 2022 18:57:34 -0800 (PST) Return-Path: <ffmpeg-devel-bounces@ffmpeg.org> Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id hb44-20020a170907162c00b007b2b5ab155esi2464969ejc.363.2022.11.18.18.57.33; Fri, 18 Nov 2022 18:57: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="sE9L/UP1"; 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 D7C5668B9AC; Sat, 19 Nov 2022 04:57:29 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05olkn2051.outbound.protection.outlook.com [40.92.89.51]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 977F268B4A2 for <ffmpeg-devel@ffmpeg.org>; Sat, 19 Nov 2022 04:57:22 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ffAhhw1WXk/ne7x8KzMu25JRUTjfgQJiVB8Ddglv1KijwycRclofEmrOyq75kamEgeC391d3FxurPmpom9x6+Fs1ZXCP7/q3TJzAUIi35pjlA9Te4xPE0gFVRpyAmpGMRVqB9SDey17zCfaUE/BwHVuFj34CA67p3sjDj5axnPB+YyYYyz5OLvlNkyLuc+bTyeWlhFQQG/duZmYzLRoAa1HDHyFciu/s3GYTnNn4Q2DLLn2+ocTFGW55ZTY6ziOgBWZDMoNs45UWzWM0RBlX0yMJ9AX1oA8jmmVz0vi0lQGLCQDIW2uqJW/oI9pLYSULmSiJjHD5I3T+ls4VZwF6oA== 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=25H0/wc63Df3kC310/ITz+yFqtMIN5qqnIR+2Vfiv/M=; b=ilOAVbW/wJ3i4YMlQ/MmqX6MK2jKeCTSzm7/ApH19x+uIDFXqYNULwpIhX0WFxsckd3rIsGZt36Rdofv1g5dbwgKqV9ROteCa/H559yCkRDU5yw/s+YNaLk/gyMtJdGcKbmuw47qdbf7L76uUgdFEdsWFMCsLBFroAHYOFcuawFkEViHAWwSfE0ZGwetC5aYQT2Av2zCQVtq9OPwTSomS8OvUxfNmEgPvZlKTIzgBLs8oq1RKTrxZbsNlrxe8rSLQUmXZpHzhABvNWjo8FpLexijRcH6cT/sdlm2z4N7bN3PlT1QIMPXnqBgQaWdKdXI3tLpLjb5ADfMaSusQoikPA== 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=25H0/wc63Df3kC310/ITz+yFqtMIN5qqnIR+2Vfiv/M=; b=sE9L/UP1MqwFuZF3Bg1nDwI1c8lKC8+W+K+JrdFrU8Ie+OC3inyqyFdy8sZedU+//UwE22fv2oA9qT02VIyRsxXMdKMLN1VXNfjlG5HuwJqYyEE7xWUL31j0SjQ40X1BfciKJHkAVF9aGnAHqgUSDieCM3OQey4lbgvZWmIolTbR56aw9lEtB5VPP2+gdD5NmoHa+JBjcRfA3d8r5BJe7JT4WmRbOtDSGCrnAoGMF7d1+V5dpdhtOMEWyyRTTuBz9YdPaQEpMmibB5zvCF1XHJ/A5D2oiVrLrGYD1QdIJY8Mmkus7K1AmVppPbIc+aOwQ0my9gwQzXaUtxumVgjr2A== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by DU2P250MB0127.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:270::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5834.9; Sat, 19 Nov 2022 02:57:19 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::5188:7559:45ea:5f52]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::5188:7559:45ea:5f52%5]) with mapi id 15.20.5813.018; Sat, 19 Nov 2022 02:57:19 +0000 From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> To: ffmpeg-devel@ffmpeg.org Date: Sat, 19 Nov 2022 03:57:23 +0100 Message-ID: <AS8P250MB07443BBA100D818B6D4B83448F089@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM> X-Mailer: git-send-email 2.34.1 X-TMN: [2gWu5h01KB/QD2jbXZKn7RGs2r3lRptGFaVM+4PcXfg=] X-ClientProxiedBy: FR2P281CA0021.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:14::8) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20221119025729.1758478-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|DU2P250MB0127:EE_ X-MS-Office365-Filtering-Correlation-Id: 229d6b6d-82b7-4565-b3c1-08dac9d9c52a X-MS-Exchange-SLBlob-MailProps: AZnQBsB9XmpdHtR81+IA7gDwjaoMToLsW7BzcLAiDYD6U+kdywPUw9K2pqdR1asaPAFfUui90wpZxP+zXmwMGvq3pMghBP+7wiAUglB9FBe12geMJ4XVnFgwYfxWmYaiFbUPwe/ptzr4hCYGn6FfR5Ck26B7gUKD5qn8EyS3mDLN0nn1NkbP25INmjS9zvBNNrAxTEXgg0RIFfcSCodjavhNDgGO2+z1QUrgDAso5G4pnJtlgGflPZMJhC9KP2dy0KzzCsgowRvJXcDnIe7q81LT1gRwEbdDT2DOrfaVSTPcs7GkD7sC/7GYK9RfZ9Z9VOmHTlpxsgqvgiC81dtk5jWtb2rFLw+UmeBIogY2HGKEaEBO9UmHN3N0ByLfJ4yMYm0cPQvzJM6C74VzAZNvvTJuRkQGiHmT59u6Q6M63mOyPCfurpFNAFvBZHFzvmXFRXAHF6llnjy+fR7jQlaygyqhf1t4xHsk4naL7S1GgMSffCp7W1LDGDqV3Da6YrpxY8RSZww8uVJOrAovbpcn30nE5jFXKL8xk2766YqmLOvFR4HhCmTamdwZ4Ac2rUb8y0yR3vdl/LPB0hxboghvfJJotp8zFs4pLGID8uHdU8q9Gktqs8L6cPkP3pwypZtoTQoX/bWlTQuJAsqiS+qedYopmHObBZzhO6y/IBLs0AKrn0OSDwsZ0S3ip6Dyx0Q+kN85WRv4x4gzWmksmRaEDb9SVV39D6y7eM3f0SXcbJn1ROzmIaTd57vZUFkjfIdmJor5rDN7/ic= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: noLH+82TOY7qBcExw0/pEeoNdsIpV6nPdHDKVCae9mOeW7B7d48YdUiHlNAqXcsefee9ZxBPzi0tz3y5B03fiyErd6LEMOZV+P9oGqQoVVho+yBadgdrjlMhgwKWFogxpWYlhEp3Sb+5+R3RnU/HEE4bB93DsUnGfnICu0DlSxf2N3otRdTHEgdZMZ0JOd+WY5u47T+ITaf3qmkLwcDoB6DxGFO+dWWeBYuPXdYquxzQgIavh3HZJmf3KY13IYXlFZwyIDthqFEg9s688T8MfVTfPAbww4Fi2Xyn9qQ+alpzD0u+P9ATe/J1xVLKWVnEAOyGYOc8YO4FbBbfbbN4vm938KipZiRuCs8WT+jk1SzpIIbXF6xnhvCGdPOcFcn5F576fh199o1UkcJizo6MSoeN4DnnEq8dsz/wBZ691ZFRGTCBeLef2KwDhpiEm3Jav9725vxNC3FoaiXY/i4eYmpOWUvupDmxbFOTiLFlyDyd8cGnTlj4I8talR6PoFFTJcDu0RTPnDaKf1uAObuM1dv4JmneM/b41J8ISxjAKb/6agVPs1bJxr7w4g0M+6JOlv+zz4xdUpe5yna9t/AjH02G52HC1AnJ5arAvXJaNltexSaxw1uN+RKCNDAKJsoTcsIjU0iV71/TYnp9Pqkt/Q== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: lkugL3Pl+P+OhjJVEz9Gj2DHT4Ye7NVAYfCFj4/WB1KIxUCcqTgz7CcyIeZyi6D92rqegtSRAlxzcbj5uDm8rzpJzkAO8I0kOvCXDQLcb80GJQWXKYQ1iTrx/0Un38IqbYf98f1z/7HwP6ojfEpF/saJcsxrlK2fENOccXL6pF/j8oZqSRF63tHGo/pG3kSDz7Cq8IXaZMgKlCXGi7BMFXdYjsXYSJefjUPm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qsUbE5LX6xXrQI= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 229d6b6d-82b7-4565-b3c1-08dac9d9c52a X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Nov 2022 02:57:19.6841 (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: DU2P250MB0127 Subject: [FFmpeg-devel] [PATCH 1/7] avcodec/pnmenc: Check av_image_get_buffer_size() X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches <ffmpeg-devel.ffmpeg.org> List-Unsubscribe: <https://ffmpeg.org/mailman/options/ffmpeg-devel>, <mailto:ffmpeg-devel-request@ffmpeg.org?subject=unsubscribe> List-Archive: <https://ffmpeg.org/pipermail/ffmpeg-devel> List-Post: <mailto:ffmpeg-devel@ffmpeg.org> List-Help: <mailto:ffmpeg-devel-request@ffmpeg.org?subject=help> List-Subscribe: <https://ffmpeg.org/mailman/listinfo/ffmpeg-devel>, <mailto:ffmpeg-devel-request@ffmpeg.org?subject=subscribe> Reply-To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" <ffmpeg-devel-bounces@ffmpeg.org> X-TUID: WoQrf85MKhfT |
Series |
[FFmpeg-devel,1/7] avcodec/pnmenc: Check av_image_get_buffer_size()
|
expand
|
Context | Check | Description |
---|---|---|
andriy/make_x86 | success | Make finished |
andriy/make_fate_x86 | success | Make fate finished |
diff --git a/libavcodec/pnmenc.c b/libavcodec/pnmenc.c index 9eb663306d..c998dd410c 100644 --- a/libavcodec/pnmenc.c +++ b/libavcodec/pnmenc.c @@ -42,7 +42,10 @@ static int pnm_encode_frame(AVCodecContext *avctx, AVPacket *pkt, int size = av_image_get_buffer_size(avctx->pix_fmt, avctx->width, avctx->height, 1); - if ((ret = ff_get_encode_buffer(avctx, pkt, size + 200, 0)) < 0) + if (size < 0) + return size; + + if ((ret = ff_get_encode_buffer(avctx, pkt, size + 200U, 0)) < 0) return ret; bytestream_start =
Fixes the crash in ticket #10050. Also ensure that we don't overflow before ff_get_encode_buffer(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavcodec/pnmenc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)