From patchwork Tue Dec 3 17:09:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 16563 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 DC3D444ACC9 for ; Tue, 3 Dec 2019 19:09:38 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BDB7668B49A; Tue, 3 Dec 2019 19:09:38 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0FC3B68B495 for ; Tue, 3 Dec 2019 19:09:33 +0200 (EET) Received: by mail-wm1-f67.google.com with SMTP id g206so3762800wme.1 for ; Tue, 03 Dec 2019 09:09:33 -0800 (PST) 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=Jli1v7Qbfh+Sh4qZYJOFH0ShjjOCA7igqlcvtivBfvE=; b=K85CIoQXByqlRYzlKY+V6R2605GqM9HZwY37WQYGgUiRV44cW3UCvW2bep5N9bBf4P S2FRtw9QpqRqHonf5y3jcg94C9H6DSRojYEBvQXtb8birgDDH26f3mRaCo/8BIRz2+yN Gv5x5p1mP7IP/7tLLl9lJOmXZPZiL6o+QHhLDA2OBiSzfUZ99J4tvRVyMQt92N62mdJS WId1uw5gviECKpOq7YVZSpChzwu/0nz75SNU5gLkH7YSCIsrO9M5jWZiAUJ9UOsLYZ78 BeGRzA3w/jIlWmiFdd/3k9leFRJvcdE4DBGZpd/OfKbbwMtzfKg5HBK5B3cgFaaEtshE J7uw== 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=Jli1v7Qbfh+Sh4qZYJOFH0ShjjOCA7igqlcvtivBfvE=; b=G1NaP00rPZjCVz2t3iITwMwz10iKvpjYJv++xWCx/1eQfWVgrMbTJujN5kWKvOpoXr xIjSuZXC2XUP2nEjsUoMFuCSwAPK/lby4uJwqH5VkYAmPrBZib5qC2DByjdrh7AsKQhC 8sRUdcbxSOSd1sxVS5RwaQgugFhsakAB8yhzWZOD6IltvQISp7Wr/tx4cA1i6cGe+mmg AZmT8xhCZBCRP3CL5YsxrCztcOMWAfaao4GmJZCTqSFraFtEAHZYppaqRIB+LcmG60hu /imtM5OdE5bPQwkDPvaZWKxr/JGVYCOob7n2233RohZrC7TcH1v/Nzw6csyJD0+OkYpb FStQ== X-Gm-Message-State: APjAAAUPFoS4ylpIfklOBFP4eXBr01zfu9OVPNJdXxCvM0Xfsk5Qr04J y8hrRMw/RLs32Qu9t9AQbROV3ggT X-Google-Smtp-Source: APXvYqwhq9GkBTfocJA0iqQfB4wygqBe4XHQKsAlFFEiinzRabLrD1FMfGJnQ6V5WfuHEunHBCG/Gw== X-Received: by 2002:a05:600c:214f:: with SMTP id v15mr23853417wml.110.1575392972372; Tue, 03 Dec 2019 09:09:32 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc08e23.dynamic.kabel-deutschland.de. [188.192.142.35]) by smtp.gmail.com with ESMTPSA id x21sm3513630wmj.44.2019.12.03.09.09.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Dec 2019 09:09:31 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 3 Dec 2019 18:09:04 +0100 Message-Id: <20191203170910.5310-2-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191203170910.5310-1-andreas.rheinhardt@gmail.com> References: <20191203170910.5310-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/8] avformat/matroskadec, avcodec/tta: Set extradata_size to 22 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" Up until c4e0e314, the seek table has been included in the tta extradata, so that the size of said extradata was 22 (the size of a TTA1 header) + 4 * number of frames. The decoder rejected anything below a size of 30 and so the Matroska demuxer exported 30 byte long extradata, of which only 18 were set (it ignores a CRC-32 and simply leaves it at 0). But this is unnecessary since said commit, so reduce the size to 22. Furthermore, replace 30 by 22 in a comment about the extradata size in libavcodec/tta.c. Signed-off-by: Andreas Rheinhardt --- libavcodec/tta.c | 2 +- libavformat/matroskadec.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/tta.c b/libavcodec/tta.c index 304f3a81df..3fbee06987 100644 --- a/libavcodec/tta.c +++ b/libavcodec/tta.c @@ -129,7 +129,7 @@ static av_cold int tta_decode_init(AVCodecContext * avctx) s->avctx = avctx; - // 30bytes includes TTA1 header + // 22 bytes for a TTA1 header if (avctx->extradata_size < 22) return AVERROR_INVALIDDATA; diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 3ce1d399e9..d50211bf4f 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -2558,7 +2558,7 @@ static int matroska_parse_tracks(AVFormatContext *s) } if (track->audio.out_samplerate < 0 || track->audio.out_samplerate > INT_MAX) return AVERROR_INVALIDDATA; - extradata_size = 30; + extradata_size = 22; extradata = av_mallocz(extradata_size + AV_INPUT_BUFFER_PADDING_SIZE); if (!extradata) return AVERROR(ENOMEM);