[FFmpeg-devel] [PATCH] libavformat/tls_securetransport: silence uninitialized value warning

Michael Niedermayer michaelni at gmx.at
Sun May 31 05:00:13 CEST 2015


On Sat, May 30, 2015 at 09:45:22PM -0500, Rodger Combs wrote:
> ---
>  libavformat/tls_securetransport.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavformat/tls_securetransport.c b/libavformat/tls_securetransport.c
> index 9951b90..c90eab7 100644
> --- a/libavformat/tls_securetransport.c
> +++ b/libavformat/tls_securetransport.c
> @@ -350,7 +350,7 @@ static int map_ssl_error(OSStatus status, size_t processed)
>  static int tls_read(URLContext *h, uint8_t *buf, int size)
>  {
>      TLSContext *c = h->priv_data;
> -    size_t processed;
> +    size_t processed = 0;
>      int ret = map_ssl_error(SSLRead(c->ssl_context, buf, size, &processed), processed);

I think you should not set an argument as a sideeffect of evaluating
another argument. The order in which they get evaluated is undefined
if iam not mistaken

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

Opposition brings concord. Out of discord comes the fairest harmony.
-- Heraclitus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150531/ff0eff66/attachment.asc>


More information about the ffmpeg-devel mailing list