From patchwork Thu Oct 20 20:16:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Cadhalpun X-Patchwork-Id: 1093 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.133 with SMTP id o127csp793923vsd; Thu, 20 Oct 2016 13:16:29 -0700 (PDT) X-Received: by 10.28.111.71 with SMTP id k68mr49386wmc.109.1476994589177; Thu, 20 Oct 2016 13:16:29 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id g7si332484wmf.107.2016.10.20.13.16.28; Thu, 20 Oct 2016 13:16:29 -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; dkim=neutral (body hash did not verify) header.i=@googlemail.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; dmarc=fail (p=QUARANTINE dis=NONE) header.from=googlemail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BD945689A9F; Thu, 20 Oct 2016 23:16:22 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lf0-f67.google.com (mail-lf0-f67.google.com [209.85.215.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 36E74689208 for ; Thu, 20 Oct 2016 23:16:17 +0300 (EEST) Received: by mail-lf0-f67.google.com with SMTP id b75so2179550lfg.3 for ; Thu, 20 Oct 2016 13:16:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:subject:message-id:date:user-agent:mime-version :content-transfer-encoding; bh=ePAEP9VyWplesa3VB2JqveObL/8fhx0VMs2zQLmtZ+c=; b=M9CyADMDs0axPd9zx5+c2Jp7PoHWF+QdbYhPdVzb7qvWJMsB62z9gOclWIA7FkM/2r 2IdYO541P6VD0PMNi2VXLkxxJgsWZA64lhoJMX8NKqUyUwupqKg/zU+kCnoL1t7Esn46 k7kITfCMiQu7e2CtXPfw9hp9wR1Y66cmHVO7yvMOQE47ORrUBQqk5JMv1UuoX8YSjhX0 kSfgM6BjXjN2QesMIpCY8ozx/hsRnuOnXVwM6DNsEh0H6+AdJpfu2HuSZpbNOK66HkcP 0FC5lo+8JBAhgt4bXamNV+cHABVE5ymKzF+JQqTA0X4tLyG2zdoHybWBDAEFsp/3iIYL U2Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=ePAEP9VyWplesa3VB2JqveObL/8fhx0VMs2zQLmtZ+c=; b=QGMrHSuJphD8j4zWF6s5MCuaJzQWQgvvkgB/QFFAdk1WzNj1ns1uWCZ5XIARobJdt3 uFyN9QrSfc6zzHRceWlZjwAwcPFSgdStpURFkfVw7Zyr9+pdz/HkciqzuDe4OSMfP6CG 9JOATEXmAcZc1RrodDl2hD0b6NKacietjmDqoBbc0aWLcSDngpJ0fgYHc74ChtmbPsuw UlDe5UTuSn2bJy9s6vBgi8WJAmgcjRe/VhremqzFOBFy6fuTU062vv96LmC7SXlGaxDg ThVoE0BqhSqK55jNOP+RyuXWGAor/3S+qREl5mf5cIG8poi3mtaCzLix7D5Ioalm8YEH WpJA== X-Gm-Message-State: AA6/9RlX030Q1klVYk/UJuQiLcSxhjuqut2WIvm7xZgg8udc7GX5juvQ2qGgbvyVIKfWtg== X-Received: by 10.28.180.85 with SMTP id d82mr52125wmf.85.1476994579466; Thu, 20 Oct 2016 13:16:19 -0700 (PDT) Received: from [192.168.2.21] (pD9E8EB48.dip0.t-ipconnect.de. [217.232.235.72]) by smtp.googlemail.com with ESMTPSA id q135sm407642wmd.16.2016.10.20.13.16.18 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Oct 2016 13:16:19 -0700 (PDT) From: Andreas Cadhalpun X-Google-Original-From: Andreas Cadhalpun To: FFmpeg development discussions and patches Message-ID: <17ff1b7f-21e5-f226-b675-4dbfc99b2183@googlemail.com> Date: Thu, 20 Oct 2016 22:16:17 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.4.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] cavsdec: unref frame before referencing again 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" This fixes asserts (from commit 13aae8) in av_frame_ref and av_frame_move_ref. Signed-off-by: Andreas Cadhalpun --- libavcodec/cavsdec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c index 70ac6f8..fed7043 100644 --- a/libavcodec/cavsdec.c +++ b/libavcodec/cavsdec.c @@ -1217,6 +1217,8 @@ static int cavs_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, h->got_keyframe = 1; } case PIC_PB_START_CODE: + if (*got_frame) + av_frame_unref(data); *got_frame = 0; if (!h->got_keyframe) break;