From patchwork Mon Jul 24 12:24:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: foo86 X-Patchwork-Id: 4435 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.1.76 with SMTP id 73csp4202241vsb; Mon, 24 Jul 2017 05:33:30 -0700 (PDT) X-Received: by 10.223.151.65 with SMTP id r59mr16850732wrb.189.1500899610136; Mon, 24 Jul 2017 05:33:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500899610; cv=none; d=google.com; s=arc-20160816; b=J/2f8iZ/pDhWh0onHeqNft3o2tiYoBb/dsZ1PMkhWgdlMP7cyhjOv5hhkJqiC5O/pA KEuP/y84U7MzlJo4kAI2RwpNrzytiVbr2u90Z+um1snAXuwwW9i1CJwUVqWdqFWTDYqJ WmUiueAw6m3wH4TYOUq3w24cImsqdzm5P1ON2fkdbr3FuU7ZqQWNBDLJrMXYKePhHDjL TVWR4cPyyAkFFvoJen3S6y+XNWW/93AvDEGjYF2izEEJiwtd9Mk5Bsx2yi6iB8DWqT0b 3yVB509LuGYojcB/9s4R4zj0B89uKTsOscMkoqeXYCaYkDH1iwRSNmxd8C8pviUU49tR B7ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=EGF1zhRXvnT74lvHrDNzHF7PReCp6tpKEbEh7QiT33Q=; b=J8MOzcjGSbIN2EZAVvImIvDqUyEBoDIHVvia2Kl0u/A1MRMB2McmgdxyKGz6RTw9H2 Jb0LzCkSUtIp/sRvPMMNTA42PzhB/vknn6sMOGjKY+lG3vzQBy87Oz4c4yK9sPsFNmvM XfA6j4fsgA5eSVQRN2xS3DHTeK9IiTDHnk1TvIS/3IX9cfpCIc3jeliN71BQCN3zCC6L 4xSu8aa+aSV1/thnL60cufmXiRAzpsG5mGKkeK1/W3E5fkPZEwBvA5VtMxZsjr1QioDE /DlMsl2gaKS6q42PV1xk2MgL1XqhPwouSeq9ZBVNYYt0CuolQRd2AB4A1YiuRa6NMxy7 rXoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.b=pn5thEQe; 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=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id b37si13036683wrb.338.2017.07.24.05.33.29; Mon, 24 Jul 2017 05:33:30 -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=@gmail.com header.b=pn5thEQe; 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=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 09B54689893; Mon, 24 Jul 2017 15:33:18 +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 319176882D7 for ; Mon, 24 Jul 2017 15:33:12 +0300 (EEST) Received: by mail-lf0-f67.google.com with SMTP id y15so3413398lfd.5 for ; Mon, 24 Jul 2017 05:33:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=e+cZHq+jvuIACoiBMMk682A1dJOCW05K/qXeoGMLr6s=; b=pn5thEQeDbgloeVSJbIZKb9bfo5GYUUQaE09JI+7OwEvHMfLjFn+AUmwi41zRtHfSY V0Js99oY6u1CgbaqitD6b5PW0ccqXkn6ROsblBKVK1/rZtkrjPjoUAZynBKzFFhBubW7 RFj0kMg/VwT88GCatzFMfjG3deBg7abICEahg2fFE6+l7HD2N5x/wxtGoTsjb8RCRHdI qBUgBoztam07xei0NFjPBWBP8ih4CFHT6fOFstwSfxVOGDPlVK7VRprGvDtv6/7MSjzT jPw0h7vrOKwgkO8jTAKwqQ0pZeNf3LMnqwFw2lURwQNvYktj8OtDaul304Q0VOn0IPUF WJ0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=e+cZHq+jvuIACoiBMMk682A1dJOCW05K/qXeoGMLr6s=; b=f1KuRhIagwNq5YlQq8gjY2eSZwNcvCcO+L8bk0JW1ipE4MCnL1Jpcu20QPnN2xtbVK U+bWuKW+s3j/a0tnt455C2zXmi12gCnW8kLb+hJUo3zZrXbW/K5aQUd8RfI/102saUCM DTuRDp3l2Bq7T3XndS6owUv3Qv1t9t/Z5qY25SfrDUimBmKXM/VXlux/UUJFRfhsI/XP KOYGUXDusjqc5AHVYP6QawObMyFks142kXzvkbnCGsic/xhZsNCFSDUo2n90czAuqHB2 kjNo+vvTD1EV3Ri+nH1Qlj84pXlZQKX5UMaYEjxIDDr/iC7derR3+6qYQfVaBY3GVPrA RgnA== X-Gm-Message-State: AIVw111pox0I8xNLLsppJW1xT1loG6ziNQNIis8AtfCOdcuemC6hD/9R gAHrtochra9Zko6M X-Received: by 10.25.18.87 with SMTP id h84mr5783009lfi.217.1500899184600; Mon, 24 Jul 2017 05:26:24 -0700 (PDT) Received: from foohost.foodomain ([2001:470:28:661::4]) by smtp.gmail.com with ESMTPSA id y1sm2323311lja.24.2017.07.24.05.26.23 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Jul 2017 05:26:23 -0700 (PDT) From: foo86 To: ffmpeg-devel@ffmpeg.org Date: Mon, 24 Jul 2017 15:24:47 +0300 Message-Id: <20170724122447.3307-2-foobaz86@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170724122447.3307-1-foobaz86@gmail.com> References: <20170724122447.3307-1-foobaz86@gmail.com> Subject: [FFmpeg-devel] [PATCH 2/2] avcodec/dcaenc: propagate errors 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" --- libavcodec/dcaenc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libavcodec/dcaenc.c b/libavcodec/dcaenc.c index c1d72bfd16..fea67bf37c 100644 --- a/libavcodec/dcaenc.c +++ b/libavcodec/dcaenc.c @@ -129,7 +129,7 @@ static int subband_bufer_alloc(DCAEncContext *c) (SUBBAND_SAMPLES + DCA_ADPCM_COEFFS), sizeof(int32_t)); if (!bufer) - return -1; + return AVERROR(ENOMEM); /* we need a place for DCA_ADPCM_COEFF samples from previous frame * to calc prediction coefficients for each subband */ @@ -153,10 +153,10 @@ static int encode_init(AVCodecContext *avctx) { DCAEncContext *c = avctx->priv_data; uint64_t layout = avctx->channel_layout; - int i, j, min_frame_bits; + int i, j, ret, min_frame_bits; - if (subband_bufer_alloc(c)) - return AVERROR(ENOMEM); + if ((ret = subband_bufer_alloc(c)) < 0) + return ret; c->fullband_channels = c->channels = avctx->channels; c->lfe_channel = (avctx->channels == 3 || avctx->channels == 6); @@ -166,8 +166,8 @@ static int encode_init(AVCodecContext *avctx) c->worst_noise_ever = -2047; c->consumed_adpcm_bits = 0; - if (ff_dcaadpcm_init(&c->adpcm_ctx)) - return AVERROR(ENOMEM); + if ((ret = ff_dcaadpcm_init(&c->adpcm_ctx)) < 0) + return ret; if (!layout) { av_log(avctx, AV_LOG_WARNING, "No channel layout specified. The "