From patchwork Sun Nov 27 17:03:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 39501 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:999a:b0:a4:2148:650a with SMTP id ve26csp6960011pzb; Sun, 27 Nov 2022 09:07:27 -0800 (PST) X-Google-Smtp-Source: AA0mqf7nuUsxONWUAPHcjzk18I35yvXozmbG56tR7WeQUov06Dk1Y7VvBW01zywOlWPZGO4Vsu09 X-Received: by 2002:a17:906:2693:b0:7aa:57c3:3f26 with SMTP id t19-20020a170906269300b007aa57c33f26mr24070981ejc.195.1669568847211; Sun, 27 Nov 2022 09:07:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669568847; cv=none; d=google.com; s=arc-20160816; b=TCQCujXm1viwyMPUIZsY6Y6Je2lRSVX/PQVLJIqRLmpyZs1KBljtBnXFLKehtcW/fj TcAztdt2tYiumRgtfJ0UVmgRkybagw9MEPBIBk9mYERLN42MtGwFMJBCq2PLpFRFYnQE S8EShpX/4CXAy0c/yY5XodCs7PRp0rVOyHHxO4jM5tqYRdbJriN9YRrNf4aIup/lz6Z1 80aYxPlT51CUMuKHfX8gXnj7bci+gLtjkELYaXfGGyvGSaZZjbxHKccL4sTcdKyxBnB6 yQiL+65W7sGLroHoYoxVyKl81kyVF3qZjgzw4bFphsNeYjunLhv+iZZMNXErsLI8w43B 7fEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=MDWZxT4jh5jHHv9J+gJ9YEkdmqG6IfQkcU3woZwNMBE=; b=O6C+j57XglnsoiMk/k+4RqDyuczzpF3+Ccwsgudrdu2+FJFgD/D3jQr+KcqK1knhbz UWMUzod5e6cEh5GNTEBBqSZKOhBMpNvkYY9w3Po3L71TavYjaipeSdH1dPGo0XVIge8u ogaDi1ExIohauvpuxVNjDfyzF2cMNel+2SrCLk6TEJ1l1qQolqmxojuHJq/NzoqrrMnY kb6AvMRurKubUL8ppitQ6xVCG6dusvoy3e72wlXAQ/zX4lEF4c/ChBUeMZsWqBOpe9rD U8evUxlwgN0R2AC6BrSD0FsiuKdgFC2EM5B3zlMGmz/pi18RHDYJXeak35JVHnQdAHJt nCpw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id ht17-20020a170907609100b007a9e6f0f82fsi7765202ejc.516.2022.11.27.09.07.26; Sun, 27 Nov 2022 09:07:27 -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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3677368B9D0; Sun, 27 Nov 2022 19:06:08 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9A1C968B79A for ; Sun, 27 Nov 2022 19:05:59 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 5F9382400F5 for ; Sun, 27 Nov 2022 18:05:58 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id 8z2lGjz8GtRq for ; Sun, 27 Nov 2022 18:05:57 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id D5C4C2406E1 for ; Sun, 27 Nov 2022 18:05:51 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 5C06A3A25C8 for ; Sun, 27 Nov 2022 18:05:46 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Sun, 27 Nov 2022 18:03:34 +0100 Message-Id: <20221127170351.11477-13-anton@khirnov.net> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221127170351.11477-1-anton@khirnov.net> References: <20221127170351.11477-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 13/30] lavc/libx264: zero reordered opaque on alloc 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 3o6dvFGZJnyz This is safer. --- libavcodec/libx264.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c index e8ca3d896b..a1b044d4e9 100644 --- a/libavcodec/libx264.c +++ b/libavcodec/libx264.c @@ -1105,8 +1105,8 @@ static av_cold int X264_init(AVCodecContext *avctx) // Overestimate the reordered opaque buffer size, in case a runtime // reconfigure would increase the delay (which it shouldn't). x4->nb_reordered_opaque = x264_encoder_maximum_delayed_frames(x4->enc) + 17; - x4->reordered_opaque = av_malloc_array(x4->nb_reordered_opaque, - sizeof(*x4->reordered_opaque)); + x4->reordered_opaque = av_calloc(x4->nb_reordered_opaque, + sizeof(*x4->reordered_opaque)); if (!x4->reordered_opaque) return AVERROR(ENOMEM);