[FFmpeg-cvslog] avformat/concatdec: check that there's extradata before trying to copy it
James Almer
git at videolan.org
Thu Nov 17 15:54:55 EET 2022
ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Thu Nov 17 10:52:33 2022 -0300| [63db6a02a78e6f1a3657d6287ea870ce10d54d9e] | committer: James Almer
avformat/concatdec: check that there's extradata before trying to copy it
The first argument for memcpy must not be NULL.
Signed-off-by: James Almer <jamrial at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=63db6a02a78e6f1a3657d6287ea870ce10d54d9e
---
libavformat/concatdec.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c
index 7748c20b6d..5d4f67d0ac 100644
--- a/libavformat/concatdec.c
+++ b/libavformat/concatdec.c
@@ -181,8 +181,9 @@ static int copy_stream_props(AVStream *st, AVStream *source_st)
if (ret < 0)
return ret;
}
- memcpy(st->codecpar->extradata, source_st->codecpar->extradata,
- source_st->codecpar->extradata_size);
+ if (source_st->codecpar->extradata_size)
+ memcpy(st->codecpar->extradata, source_st->codecpar->extradata,
+ source_st->codecpar->extradata_size);
return 0;
}
if ((ret = avcodec_parameters_copy(st->codecpar, source_st->codecpar)) < 0)
More information about the ffmpeg-cvslog
mailing list