From patchwork Mon Jun 17 03:42:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 13572 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 6EED5447BCA for ; Mon, 17 Jun 2019 06:49:42 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 591DC68A326; Mon, 17 Jun 2019 06:49:42 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C76EC6801A4 for ; Mon, 17 Jun 2019 06:49:40 +0300 (EEST) Received: by mail-wr1-f68.google.com with SMTP id x17so8234319wrl.9 for ; Sun, 16 Jun 2019 20:49:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=A3wxPA1whfqCJ7F+kml7h8X0S4FRp/0lz9vzldAE4LM=; b=GMXNpuUPpgbHrg0YvB8jjk56D8+4adSqKBT2hhSSeVjbmw0g+e8kLV7egM9RKVKdvK CIAmXtRjGsTq60Wi/aM2ZAk8WI/kjIMXP372AvwudK59SSuagMGGMqpEckfPqypy7TW3 Hs66Wnu3Jvws6X9rL6nGIdXi3gFHeJqgWiU4l4wXx6TyHU98ENyf0bfwvfMG7r2bMMtM VY+4RAvwNC608n1k0pqFyEIwdHT9OiZZaxiO664TqaEOtCy9622AjvZFEay8mtibGyY5 eVjR+cBDj3+ogYqIu/2OpqEViGsZTk2XQwbw9RQZNpeKVlIsDN3378wgZHYfGftZQwT6 v9WA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=A3wxPA1whfqCJ7F+kml7h8X0S4FRp/0lz9vzldAE4LM=; b=pNt92mWdIO8l59T0dbWx7wg4LCAfqVi9zkLrdFFKFbhh/1mswXITLWJNyPgXEvLlRl oZ6RvdTFdY+6fdUFo7nxAilPHWT6IcI/9FaonzLQVmlcDPuZ/ZjjFeE3QKXBA/SP3dzd jaFxazQ746M4w2lF4GBP4SetlO+bNEOlII1RXQiUIU+0NIN6EWWFlLCiFwmFYJlLzt9v kn6NTJYUYbxJCXH3I8fEdEf+XF4SezhCGLwnok/J1dxqoY0Be5LLA6kaFKtA44qp05VH 4W1Uk2yh/hJ9vjzya9xqDiMnY3e47yq5qpVu+gPx1CiovkHnZGBKxVUN1bYA83W/82p9 /hWg== X-Gm-Message-State: APjAAAWMPLR6UBQccQRsC/twcUV1O8xpn8+PGPO8p1PR+QQaWm1VQwul 4FBNZGjN7y/rUs+39JwzmuC9b6iz X-Google-Smtp-Source: APXvYqy/CvGmEJYlBNhBHP9I8peUjGhfioq1sKe2GfXkztOqZNkOZL4FaicFsVKG6oMg8b3DVbO5nw== X-Received: by 2002:a5d:4909:: with SMTP id x9mr8456168wrq.226.1560743035415; Sun, 16 Jun 2019 20:43:55 -0700 (PDT) Received: from localhost.localdomain (ipbcc063db.dynamic.kabel-deutschland.de. [188.192.99.219]) by smtp.gmail.com with ESMTPSA id x83sm9632889wmb.42.2019.06.16.20.43.54 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 16 Jun 2019 20:43:55 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 17 Jun 2019 05:42:08 +0200 Message-Id: <20190617034223.21195-4-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190617034223.21195-1-andreas.rheinhardt@gmail.com> References: <20190617034223.21195-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 03/18] filter_units: Unref packet on failure X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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" According to the API, the packet structure a bsf receives must not be touched on failure, yet filter_units nevertheless did it. Signed-off-by: Andreas Rheinhardt --- libavcodec/filter_units_bsf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/filter_units_bsf.c b/libavcodec/filter_units_bsf.c index bc2ca288dd..0876693c81 100644 --- a/libavcodec/filter_units_bsf.c +++ b/libavcodec/filter_units_bsf.c @@ -153,6 +153,8 @@ static int filter_units_filter(AVBSFContext *bsf, AVPacket *out) goto fail; fail: + if (err < 0) + av_packet_unref(out); ff_cbs_fragment_reset(ctx->cbc, frag); av_packet_free(&in);