From patchwork Thu Oct 13 13:48:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 38716 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4a86:b0:9d:28a3:170e with SMTP id fn6csp348680pzb; Thu, 13 Oct 2022 06:49:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5lz/8qtT4gPyvAe2SDCs2X3e0zVY0k1L2o4hScjKiWApKNyV3zfSi6Ub9UDXlavaFIGoHA X-Received: by 2002:a05:6402:2285:b0:45c:7c8c:3032 with SMTP id cw5-20020a056402228500b0045c7c8c3032mr11790678edb.78.1665668965962; Thu, 13 Oct 2022 06:49:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665668965; cv=none; d=google.com; s=arc-20160816; b=V0AZmNKMTJlD1/M2tRq1dM9MSKzD4nzZNAElD3xhwpaLtVc5qWQ7e+ZMNr5YqjV2QH 4vt5NYZhIjnyWWleMCSq3ya6stQi27PuySA9/3RGaj7f+O5e0j8tsS91oH3UdjaX+XpT zgIHga7E8J7FyGw9G9v93nkm8VS1TsPiaTYkZP3w73t9qlyW6/y86yBy4OCsukitiGko 2kpnCgSTg1vwv7MI1ez8HgD2ZzhQhgsQ2kQSvI7PnU72tkILNXz4nI1FbsXrfP0CfetE lWfXpUQMHSaddVeLvYACXHVOwFh7S5HnmdRsqCpxny+Xk7JIxixNHhSRLUQgEsGYcc2X nhfg== 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:message-id:date:to:from :delivered-to; bh=KxJJ72XIaE/fJQ2fAJccur3VxAh8L9vVwrLh6s6+wLI=; b=LZ+q9sJr4JwsP3wDthonJIC0DuHJ1YGID2G+ghuNXqgWTwRaPVjAc0PDcEyCHUK0JV r4u4nPtcvML1ZQVVd18LYitGu2GWKtTPwYZ38npjAXXe7X9nczORwjGoqty/ADNkSbJ5 uulU4ds3vTHcUcQsUMHQB2meIK8nGVjrTaT8E8e4cZnxynhFgYQJWiTqjZrLbFZjA43U RjKB3Ok3evLEc0YCobumzhwU1si1B2SmKXVPzcM3dMtdUzL/HJ9AxyjN6BvtJ5IN3riF 7ajMMjdl8PFUDbcl2I6FMyes9MuU/lxbt1P80lndjaoYVDwiVCwJf4F5e1PeDwSQKVVi EQFw== 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 s19-20020aa7c553000000b0045ca3644a63si4118781edr.546.2022.10.13.06.49.25; Thu, 13 Oct 2022 06:49:25 -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; 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 2020268BD49; Thu, 13 Oct 2022 16:49:21 +0300 (EEST) 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 3F2EA68B86B for ; Thu, 13 Oct 2022 16:49:14 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 8A9E82406CC for ; Thu, 13 Oct 2022 15:49:13 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id 62sEE_5KM8rT for ; Thu, 13 Oct 2022 15:49:13 +0200 (CEST) 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 1F2E32400F4 for ; Thu, 13 Oct 2022 15:49:13 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 026313A056E for ; Thu, 13 Oct 2022 15:49:08 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Thu, 13 Oct 2022 15:48:52 +0200 Message-Id: <20221013134904.10104-1-anton@khirnov.net> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 01/13] fftools/ffmpeg_mux: do not unref a NULL packet 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: FzhjYswfEdRf The packet submitted to of_submit_packet() may be NULL to signal EOF. --- fftools/ffmpeg_mux.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fftools/ffmpeg_mux.c b/fftools/ffmpeg_mux.c index 395f7cc89f..a6877ae5ec 100644 --- a/fftools/ffmpeg_mux.c +++ b/fftools/ffmpeg_mux.c @@ -329,7 +329,8 @@ int of_submit_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost) /* the muxer is not initialized yet, buffer the packet */ ret = queue_packet(of, ost, pkt); if (ret < 0) { - av_packet_unref(pkt); + if (pkt) + av_packet_unref(pkt); return ret; } }