[FFmpeg-user] compiler warnings current snapshot

Reindl Harald h.reindl at thelounge.net
Mon Jan 15 04:10:55 EET 2018


in current snapshot there are tons of "arning: 
'__builtin___snprintf_chk' output may be truncated before the last 
format character [-Wformat-truncation=]" warnings and below some other 
warnings and the second one sounds really serious

does anybody of the developers turn warnings on and use a recent GCC?
_______________________________

src/libavformat/tls_openssl.c: In function 'ff_openssl_deinit':
src/libavformat/tls_openssl.c:105:43: warning: the comparison will 
always evaluate as 'false' for the address of 'openssl_lock' will never 
be NULL [-Waddress]
          if (CRYPTO_get_locking_callback() == openssl_lock) {
_______________________________

In file included from src/libavutil/common.h:491:0,
                  from src/libavutil/avutil.h:296,
                  from src/libavutil/opt.h:31,
                  from src/libavcodec/alac.c:51:
src/libavcodec/alac.c: In function 'allocate_buffers':
src/libavutil/internal.h:142:9: warning: argument 1 value 
'18446744073709551552' exceeds maximum object size 9223372036854775807 
[-Walloc-size-larger-than=]
      p = av_malloc(size);\
_______________________________

In file included from /usr/include/stdio.h:939:0,
                  from src/libavformat/avformat.h:318,
                  from src/libavformat/smoothstreamingenc.c:28:
/usr/include/bits/stdio2.h:64:10: note: '__builtin___snprintf_chk' 
output between 10 and 1033 bytes into a destination of size 1024
    return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         __bos (__s), __fmt, __va_arg_pack ());
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_______________________________

src/libavformat/smoothstreamingenc.c: In function 'ism_write_header':
src/libavformat/smoothstreamingenc.c:327:52: warning: '/QualityLevels(' 
directive output may be truncated writing 15 bytes into a region of size 
between 1 and 1024 [-Wformat-truncation=]
          snprintf(os->dirname, sizeof(os->dirname), 
"%s/QualityLevels(%"PRId64")", s->filename, 
s->streams[i]->codecpar->bit_rate);
                                                     ^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:939:0,
                  from src/libavformat/avformat.h:318,
                  from src/libavformat/smoothstreamingenc.c:28:
/usr/include/bits/stdio2.h:64:10: note: '__builtin___snprintf_chk' 
output between 18 and 1060 bytes into a destination of size 1024
    return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         __bos (__s), __fmt, __va_arg_pack ());
_______________________________
 
^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:939:0,
                  from src/libavformat/avformat.h:318,
                  from src/libavformat/smoothstreamingenc.c:28:
/usr/include/bits/stdio2.h:64:10: note: '__builtin___snprintf_chk' 
output 15 or more bytes (assuming 1038) into a destination of size 1024
    return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         __bos (__s), __fmt, __va_arg_pack ());

_______________________________

In file included from /usr/include/stdio.h:939:0,
                  from src/libavformat/avformat.h:318,
                  from src/libavformat/rtspdec.c:27:
/usr/include/bits/stdio2.h:64:10: note: '__builtin___snprintf_chk' 
output between 16 and 1039 bytes into a destination of size 1024
    return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         __bos (__s), __fmt, __va_arg_pack ());
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

_______________________________

src/libavformat/rtmpcrypt.c: In function 'rtmpe_write':
src/libavformat/rtmpcrypt.c:304:36: warning: passing argument 2 of 
'av_rc4_crypt' discards 'const' qualifier from pointer target type 
[-Wdiscarded-qualifiers]
          av_rc4_crypt(&rt->key_out, buf, buf, size, NULL, 1);
                                     ^~~
In file included from src/libavformat/rtmpcrypt.c:32:0:
src/libavutil/rc4.h:60:6: note: expected 'uint8_t * {aka unsigned char 
*}' but argument is of type 'const uint8_t * {aka const unsigned char *}'
  void av_rc4_crypt(struct AVRC4 *d, uint8_t *dst, const uint8_t *src, 
int count, uint8_t *iv, int decrypt);
       ^~~~~~~~~~~~
_______________________________

src/libavformat/movenc.c: In function 'mov_flush_fragment':
src/libavformat/movenc.c:957:8: warning: assuming signed overflow does 
not occur when assuming that (X - c) > X is always false [-Wstrict-overflow]
      if (cluster_idx >= track->entry)
         ^


More information about the ffmpeg-user mailing list