From patchwork Mon Feb 22 03:01:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zane van Iperen X-Patchwork-Id: 25882 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 D319644A365 for ; Mon, 22 Feb 2021 05:02:15 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B401268A6B6; Mon, 22 Feb 2021 05:02:15 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from out0.migadu.com (out0.migadu.com [94.23.1.103]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 303DA68A28B for ; Mon, 22 Feb 2021 05:02:07 +0200 (EET) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zanevaniperen.com; s=key1; t=1613962926; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=E3D/qx26sb0X/dik7gBfe6x0u3AYpYPT6Gz+Np5Q1u4=; b=Reve+QCwthFAJGDD09VIzf0xRY/ojfZUerCCGOdw+C0CETuiK9TLVOFeg7/J6YuunyCkzm HTxopQGD9wRMtwAjX6+0TR6WQ7hlTJyZiSWMaBgmpbUZkn0NB5xBSeScqpJMB5M44k0Kgs e4nRnhZ++FxbWVti1zaTmWioC05Cr9/hcVAg192OMnY+lzUSUicLeue0iNE/p2yF2fvo7O DRUsLhdUsJ0jMEDH1RM/nTpoKtUwV9G/k3hsihThgvK5F46VllS6F75J6AAn1FoQ/2C6gO fgBK+hkJ2+F6VgCj1UEw97TQ7LqKnVsl49LOUd0XKm4DqLu4MScDUHCR32Q6gg== From: Zane van Iperen To: ffmpeg-devel@ffmpeg.org Date: Mon, 22 Feb 2021 13:01:44 +1000 Message-Id: <20210222030144.3291269-2-zane@zanevaniperen.com> In-Reply-To: <20210222030144.3291269-1-zane@zanevaniperen.com> References: <20210222030144.3291269-1-zane@zanevaniperen.com> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: git-morningstar@zanevaniperen.com Subject: [FFmpeg-devel] [PATCH 2/2] avcodec/adpcm_ima_apm: cosmetics 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: Zane van Iperen Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Zane van Iperen --- libavcodec/adpcm.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c index e38e81310c..3f4dccf124 100644 --- a/libavcodec/adpcm.c +++ b/libavcodec/adpcm.c @@ -165,13 +165,11 @@ static av_cold int adpcm_decode_init(AVCodecContext * avctx) } break; case AV_CODEC_ID_ADPCM_IMA_APM: - if (avctx->extradata) { - if (avctx->extradata_size >= 28) { - c->status[0].predictor = av_clip_intp2(AV_RL32(avctx->extradata + 16), 18); - c->status[0].step_index = av_clip(AV_RL32(avctx->extradata + 20), 0, 88); - c->status[1].predictor = av_clip_intp2(AV_RL32(avctx->extradata + 4), 18); - c->status[1].step_index = av_clip(AV_RL32(avctx->extradata + 8), 0, 88); - } + if (avctx->extradata && avctx->extradata_size >= 28) { + c->status[0].predictor = av_clip_intp2(AV_RL32(avctx->extradata + 16), 18); + c->status[0].step_index = av_clip(AV_RL32(avctx->extradata + 20), 0, 88); + c->status[1].predictor = av_clip_intp2(AV_RL32(avctx->extradata + 4), 18); + c->status[1].step_index = av_clip(AV_RL32(avctx->extradata + 8), 0, 88); } break; case AV_CODEC_ID_ADPCM_IMA_WS: