[FFmpeg-devel] [PATCH 2/2] mpegtsenc: Don't pass NULL to memcpy

Michael Niedermayer michael at niedermayer.cc
Fri Jul 7 01:13:02 EEST 2017


On Thu, Jul 06, 2017 at 06:34:21PM +0100, Derek Buitenhuis wrote:
> Signed-off-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>
> ---
>  libavformat/mpegtsenc.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
> index acea2e93a6..f62ed55dea 100644
> --- a/libavformat/mpegtsenc.c
> +++ b/libavformat/mpegtsenc.c
> @@ -277,6 +277,8 @@ static void putstr8(uint8_t **q_ptr, const char *str, int write_len)
>          len = strlen(str);
>      if (write_len)
>          *q++ = len;
> +    if (!str)
> +        return;
>      memcpy(q, str, len);
>      q     += len;

>      *q_ptr = q;

this should not be skiped if str==NULL

otherwise LGTM

thx

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

Those who would give up essential Liberty, to purchase a little
temporary Safety, deserve neither Liberty nor Safety -- Benjamin Franklin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170707/00f1e749/attachment.sig>


More information about the ffmpeg-devel mailing list