diff options
author | James Almer <jamrial@gmail.com> | 2022-11-17 10:52:33 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2022-11-17 10:53:20 -0300 |
commit | 63db6a02a78e6f1a3657d6287ea870ce10d54d9e (patch) | |
tree | 03b030db29a664daf6f1bcb6b8715b0aa093a4d7 /libavformat/concatdec.c | |
parent | cb925c0bc059ce54cb6f8d858d43378ec516f548 (diff) | |
download | ffmpeg-63db6a02a78e6f1a3657d6287ea870ce10d54d9e.tar.gz |
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@gmail.com>
Diffstat (limited to 'libavformat/concatdec.c')
-rw-r--r-- | libavformat/concatdec.c | 5 |
1 files 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) |