[FFmpeg-devel] [PATCH 1/2] avformat/rpl: Replace strcpy with av_strlcpy

Michael Niedermayer michael at niedermayer.cc
Wed Jul 10 11:26:02 EEST 2019


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 <ccawley2011 at gmail.com>
Date:   Thu Jun 27 20:56:02 2019 +0100

    avformat/rpl: Support files containing Replay IMA ADPCM audio
    
    Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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)

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

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

"Nothing to hide" only works if the folks in power share the values of
you and everyone you know entirely and always will -- Tom Scott

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190710/e4e2a9f7/attachment.sig>


More information about the ffmpeg-devel mailing list