From patchwork Fri Mar 19 05:58:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 26470 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 2DEC1449D11 for ; Fri, 19 Mar 2021 07:59:52 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DF55068A880; Fri, 19 Mar 2021 07:59:51 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E10D968A682 for ; Fri, 19 Mar 2021 07:59:41 +0200 (EET) Received: by mail-ej1-f53.google.com with SMTP id jy13so7726907ejc.2 for ; Thu, 18 Mar 2021 22:59:41 -0700 (PDT) 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:reply-to :mime-version:content-transfer-encoding; bh=0VfeZon+vIKaDVTObW3wFo/3GT2I5n7Rt8+OlC9H3HM=; b=RI7LC1UgGU2CahXcXvVhnRU8e0NMllgg7pofnn2WVhHhoBUGWn/utpi/p8U4lAo7+d pRfUC/7g5XDkCzqIa6ey3tMntXTMggjZWTC1v1YbdObELLk72c7t5VGOXXLoiR1KXfud ypK/FbbfA+ZxuFdAmARGJuOHNrtOkGYIl/uuOdmk+g8ZBFFXfy2jsZDwFd5KnTKZYjwV Nz8MUJYtk5u3ja3Owz7QK7SJ4fUo1Z9A64Xks58APsoxLDGkX8xiMcEGcS4UrqpLoKo2 k7UdJkfb6gCNICNeAT1D3Rv3AI2LSLWYA6TJ3vQ+XDGIthvbhNNXis37SvGpS+JwyPJK RTEA== 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:reply-to:mime-version:content-transfer-encoding; bh=0VfeZon+vIKaDVTObW3wFo/3GT2I5n7Rt8+OlC9H3HM=; b=CACLvGUgGOTQu2nB14qQhKBWPEm3NjQm5n8ACesQkdw2AqzNfQBoyg+htQ/AG0eOvK BbvmvvNep38YpjnB5i1IvUxXglTSDwAas7sp9KFqIPdtfj6472EM3tP/4R/ZviiOjtME eu45l6yfitxeA81bDAbda0KaNw6cIbT0l7z5iirBageDadziwjy2G8G+2dmaRfDvoE7v L5k75IPhho6rl3gSK2c/GLMmln11tM8ZkbtuZCcBhZyAIk4B1VsBX5uIqvq4c/g7KP2O hGbd57YEvNdARNvMErZsq/oO5RGk0JBWnmDWpJ33aq0SW7XECiis1icaTWI+7zUL9hrN In0A== X-Gm-Message-State: AOAM532pKoq+FAB/bXO5GPoGCutk26TLkbkbd98jMmobBQxxSMn4TBGv 82mYB5p+cD7l2lLeLGzKCJiJQWELWx+MSg== X-Google-Smtp-Source: ABdhPJwXPwpH1navlqBSv0UgxH49TiWYSmPq2LAENMcvkLWKRk54aZ9O5fsBBSIr5Dtjs7Q6IpQzJw== X-Received: by 2002:a17:907:1b20:: with SMTP id mp32mr2406096ejc.495.1616133581301; Thu, 18 Mar 2021 22:59:41 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc08960.dynamic.kabel-deutschland.de. [188.192.137.96]) by smtp.gmail.com with ESMTPSA id x17sm3109344ejd.68.2021.03.18.22.59.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Mar 2021 22:59:40 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 19 Mar 2021 06:58:53 +0100 Message-Id: <20210319055904.2264501-7-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210319055904.2264501-1-andreas.rheinhardt@gmail.com> References: <20210319055904.2264501-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 07/18] avformat/asfdec_f: Avoid stack packet 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" Replace it by using AVFormatInternal.parse_pkt which is otherwise unused when reading a header. Signed-off-by: Andreas Rheinhardt --- libavformat/asfdec_f.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavformat/asfdec_f.c b/libavformat/asfdec_f.c index 1484b544d9..2fae528f4d 100644 --- a/libavformat/asfdec_f.c +++ b/libavformat/asfdec_f.c @@ -860,17 +860,17 @@ static int asf_read_header(AVFormatContext *s) } else { if (!s->keylen) { if (!ff_guidcmp(&g, &ff_asf_content_encryption)) { + AVPacket *pkt = s->internal->parse_pkt; unsigned int len; - AVPacket pkt; av_log(s, AV_LOG_WARNING, "DRM protected stream detected, decoding will likely fail!\n"); len= avio_rl32(pb); av_log(s, AV_LOG_DEBUG, "Secret data:\n"); - if ((ret = av_get_packet(pb, &pkt, len)) < 0) + if ((ret = av_get_packet(pb, pkt, len)) < 0) return ret; - av_hex_dump_log(s, AV_LOG_DEBUG, pkt.data, pkt.size); - av_packet_unref(&pkt); + av_hex_dump_log(s, AV_LOG_DEBUG, pkt->data, pkt->size); + av_packet_unref(pkt); len= avio_rl32(pb); if (len > UINT16_MAX)