From patchwork Sun Apr 25 01:30:29 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: 27335 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:5014:0:0:0:0:0 with SMTP id e20csp2771937iob; Sat, 24 Apr 2021 18:31:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzuT7mW/xSBgXvjzlPoXquJeu1R9MQjITuDk3CDKqDSn0V88zsBrEcE2Q7+CQ3XEEPOea2I X-Received: by 2002:a17:906:ecb8:: with SMTP id qh24mr11754214ejb.162.1619314259907; Sat, 24 Apr 2021 18:30:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619314259; cv=none; d=google.com; s=arc-20160816; b=u5rwhoIjYs8gXYq10cYS/8ErbFP5CEp6itHl5FtqUvqmOOu8hOt30lkfaH0T6cuIZz s/kwRAWRruBjymnbJ6hlC73BS4hMY6KgXnbtQ5JhBmYJoVL68vTgM+doZx2Vmmx9SGlH DD8UVqHu9NbKqzv4UFnkKzyzP9Rxl82g0XVzfg8jPnsBAadwy9VvrBzlsAKfcYA90vA4 3wWQDxz9mi9c4wfcl5tmXLuTln6vus7Bu0+CqfFFj/UZoptyR+jsL2bG9zG8n0iNpT+e HBnjSUFuvagl+ku9Zt4Fxq3aZWS2nRHRZVK45dqSlzZ2737ind24aSlRxkDam4+UZzzf ryvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=ICY5WyYk90fiFYGVM4HA2XiQGw5dYYLWXjB+JAs1fKI=; b=qlwdprrcReX/eD2pV5l5DAyXwApMqXy2T2GJUoHhGjxMNpq3NOn2ad/h6KKTx9Rra2 W4meO8WIfv9QqgBTqSdWYxzqTJ4HT00O0o6SIdFpFnLnMzn91kqIftFBx0DBGwJFTlGx 6jU0c/W9TOKgDN5oVX74RwD8JGJawDerxeS1qIdDhhtio0JhWbVpzzkuKyJ8Dilx0mwS TQ/jYZVs12Ik884OZJgAnsxsTSygpSl53l/U2eUMDZm/eoD6qMBNvHSRs86dpKGGuu9J +pgUs2MZ0/+kCEJZ7NXbacmpMnWtT/QgZ2vvTWjtnGICWzEv+wWndkbVQInXzx0hJ9dP S+Jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@zanevaniperen.com header.s=key1 header.b=VUawO8RI; 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=zanevaniperen.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id p25si11360625ejc.571.2021.04.24.18.30.59; Sat, 24 Apr 2021 18:30:59 -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=@zanevaniperen.com header.s=key1 header.b=VUawO8RI; 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=zanevaniperen.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C16FE680C82; Sun, 25 Apr 2021 04:30:55 +0300 (EEST) 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 A231E680279 for ; Sun, 25 Apr 2021 04:30:49 +0300 (EEST) 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=1619314249; 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; bh=WUKwHN1WHE8vLhyFYEuCjYlMR6BQGS3PGYqu8vPaPoA=; b=VUawO8RIlL6Iml8mRjaN5fMMXHtBuxM2e5cFC6yS345nZBHOZJdEfl3h1eFb+UuWswyYsp K2hTQ7MmI4kLhpxCvYmp5WIlVjG3iYQ8i1/DvdK5suKsthR9/D5DXfIHka18Kagq/BS+Xf VxuKkmwz2JVxUWTw01zB0Zz2zPf+JS47e3thqZduYZnD33xJKmAsact7lqYvNN2O00YQTT YHK/BQwo6z4161+/7oJfA4l2khk26n4ZpdZ1hZY5oOuPVJtibNordCYR7Qh0Bn2XoiGgj6 AjjYF/l6aYJgxYwC565hmxm1hKORRGbfP5Mi22MN2hwRWux6+IMsCoL+EEzXlA== From: Zane van Iperen To: ffmpeg-devel@ffmpeg.org Date: Sun, 25 Apr 2021 11:30:29 +1000 Message-Id: <20210425013029.1563-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] avcodec/adpcm: init from extradata before setting sample formats 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 Cc: Zane van Iperen , Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 62q5c6UoeIpy Fixes a crash when decoding VQA files. Reported-by: Andreas Rheinhardt Signed-off-by: Zane van Iperen --- libavcodec/adpcm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c index be14607eac..b031e24981 100644 --- a/libavcodec/adpcm.c +++ b/libavcodec/adpcm.c @@ -111,6 +111,8 @@ static av_cold int adpcm_decode_init(AVCodecContext * avctx) unsigned int min_channels = 1; unsigned int max_channels = 2; + adpcm_flush(avctx); + switch(avctx->codec->id) { case AV_CODEC_ID_ADPCM_IMA_AMV: max_channels = 1; @@ -201,8 +203,6 @@ static av_cold int adpcm_decode_init(AVCodecContext * avctx) default: avctx->sample_fmt = AV_SAMPLE_FMT_S16; } - - adpcm_flush(avctx); return 0; }