From patchwork Wed Jul 10 08:26:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 13887 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 B9F02448F74 for ; Wed, 10 Jul 2019 11:26:11 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9123368AB1C; Wed, 10 Jul 2019 11:26:11 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay12.mail.gandi.net (relay12.mail.gandi.net [217.70.178.232]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4216F68A92E for ; Wed, 10 Jul 2019 11:26:05 +0300 (EEST) Received: from localhost (213-47-41-20.cable.dynamic.surfer.at [213.47.41.20]) (Authenticated sender: michael@niedermayer.cc) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 85EF6200012 for ; Wed, 10 Jul 2019 08:26:04 +0000 (UTC) Date: Wed, 10 Jul 2019 10:26:02 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20190710082602.GS3118@michaelspb> References: <20190629230044.28388-1-ccawley2011@gmail.com> <20190705161805.GK3118@michaelspb> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Subject: Re: [FFmpeg-devel] [PATCH 1/2] avformat/rpl: Replace strcpy with av_strlcpy 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" On Tue, Jul 09, 2019 at 10:46:14PM +0100, Cameron Cawley wrote: > The second use of strcpy() that this patch fixes was added in > commit 0e9c01f. the first strcpy is added by: commit ee32e12ccb0d2af99c356ff7730ecfa07fd5c945 Author: Cameron Cawley Date: Thu Jun 27 20:56:02 2019 +0100 avformat/rpl: Support files containing Replay IMA ADPCM audio Signed-off-by: Michael Niedermayer Its not good to apply patches which add bad code just to remove it again in the next commit ill apply the strcpy hunk which (should) apply to git master thanks [...] diff --git a/libavformat/rpl.c b/libavformat/rpl.c index 17b45e3a67..c28ae696ac 100644 --- a/libavformat/rpl.c +++ b/libavformat/rpl.c @@ -189,7 +190,9 @@ static int rpl_read_header(AVFormatContext *s) // ARMovie supports multiple audio tracks; I don't have any // samples, though. This code will ignore additional tracks. - audio_format = read_line_and_int(pb, &error); // audio format ID + error |= read_line(pb, line, sizeof(line)); + audio_format = read_int(line, &endptr, &error); // audio format ID + strcpy(audio_codec, endptr); if (audio_format) { ast = avformat_new_stream(s, NULL); if (!ast)