[FFmpeg-cvslog] mpegtsenc: Don't pass NULL to memcpy
Derek Buitenhuis
git at videolan.org
Fri Jul 7 04:28:43 EEST 2017
ffmpeg | branch: master | Derek Buitenhuis <derek.buitenhuis at gmail.com> | Thu Jul 6 13:23:06 2017 -0400| [fde9013ab42411ee2015811c28e8921828a81702] | committer: Derek Buitenhuis
mpegtsenc: Don't pass NULL to memcpy
Signed-off-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fde9013ab42411ee2015811c28e8921828a81702
---
libavformat/mpegtsenc.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index acea2e93a6..fdfa544ee2 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -277,6 +277,10 @@ static void putstr8(uint8_t **q_ptr, const char *str, int write_len)
len = strlen(str);
if (write_len)
*q++ = len;
+ if (!str) {
+ *q_ptr = q;
+ return;
+ }
memcpy(q, str, len);
q += len;
*q_ptr = q;
More information about the ffmpeg-cvslog
mailing list