libavformat/adtsenc.c:85: error: Buffer Overrun L2
  Offset: [3, 59] (⇐ [0, 56] + 3) Size: 7 by call to `put_bits`.

libavformat/adtsenc.c:60:1: Array declaration
58. }
59. 
60. static int adts_write_frame_header(AVFormatContext *s, int size)
    ^
61. {
62.     ADTSContext *ctx = s->priv_data;

libavformat/adtsenc.c:66:5: Call
64.     uint8_t buf[ADTS_HEADER_SIZE];
65. 
66.     init_put_bits(&pb, buf, ADTS_HEADER_SIZE);
        ^
67. 
68.     /* adts_fixed_header */

libavcodec/bitstream.h:90:1: Parameter `*buffer`
  88. } PutBitContext;
  89. 
  90. static inline void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
      ^
  91. {
  92.     if(buffer_size < 0) {

libavcodec/bitstream.h:97:5: Assignment
  95.     }
  96. 
  97.     s->buf = buffer;
          ^
  98.     s->buf_end = s->buf + buffer_size;
  99. #ifdef ALT_BITSTREAM_WRITER

libavcodec/bitstream.h:104:5: Assignment
  102. //    memset(buffer, 0, buffer_size);
  103. #else
  104.     s->buf_ptr = s->buf;
           ^
  105.     s->bit_left=32;
  106.     s->bit_buf=0;

libavformat/adtsenc.c:69:5: Call
67. 
68.     /* adts_fixed_header */
69.     put_bits(&pb, 12, 0xfff);   /* syncword */
        ^
70.     put_bits(&pb, 1, 0);        /* ID */
71.     put_bits(&pb, 2, 0);        /* layer */

libavcodec/bitstream.h:183:1: Parameter `*s->buf_ptr`
  181. 
  182. #ifndef ALT_BITSTREAM_WRITER
  183. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
       ^
  184. {
  185.     unsigned int bit_buf;

libavformat/adtsenc.c:70:5: Call
68.     /* adts_fixed_header */
69.     put_bits(&pb, 12, 0xfff);   /* syncword */
70.     put_bits(&pb, 1, 0);        /* ID */
        ^
71.     put_bits(&pb, 2, 0);        /* layer */
72.     put_bits(&pb, 1, 1);        /* protection_absent */

libavcodec/bitstream.h:183:1: Parameter `*s->buf_ptr`
  181. 
  182. #ifndef ALT_BITSTREAM_WRITER
  183. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
       ^
  184. {
  185.     unsigned int bit_buf;

libavformat/adtsenc.c:71:5: Call
69.     put_bits(&pb, 12, 0xfff);   /* syncword */
70.     put_bits(&pb, 1, 0);        /* ID */
71.     put_bits(&pb, 2, 0);        /* layer */
        ^
72.     put_bits(&pb, 1, 1);        /* protection_absent */
73.     put_bits(&pb, 2, ctx->objecttype); /* profile_objecttype */

libavcodec/bitstream.h:183:1: Parameter `*s->buf_ptr`
  181. 
  182. #ifndef ALT_BITSTREAM_WRITER
  183. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
       ^
  184. {
  185.     unsigned int bit_buf;

libavformat/adtsenc.c:72:5: Call
70.     put_bits(&pb, 1, 0);        /* ID */
71.     put_bits(&pb, 2, 0);        /* layer */
72.     put_bits(&pb, 1, 1);        /* protection_absent */
        ^
73.     put_bits(&pb, 2, ctx->objecttype); /* profile_objecttype */
74.     put_bits(&pb, 4, ctx->sample_rate_index);

libavcodec/bitstream.h:183:1: Parameter `*s->buf_ptr`
  181. 
  182. #ifndef ALT_BITSTREAM_WRITER
  183. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
       ^
  184. {
  185.     unsigned int bit_buf;

libavformat/adtsenc.c:73:5: Call
71.     put_bits(&pb, 2, 0);        /* layer */
72.     put_bits(&pb, 1, 1);        /* protection_absent */
73.     put_bits(&pb, 2, ctx->objecttype); /* profile_objecttype */
        ^
74.     put_bits(&pb, 4, ctx->sample_rate_index);
75.     put_bits(&pb, 1, 0);        /* private_bit */

libavcodec/bitstream.h:183:1: Parameter `*s->buf_ptr`
  181. 
  182. #ifndef ALT_BITSTREAM_WRITER
  183. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
       ^
  184. {
  185.     unsigned int bit_buf;

libavformat/adtsenc.c:74:5: Call
72.     put_bits(&pb, 1, 1);        /* protection_absent */
73.     put_bits(&pb, 2, ctx->objecttype); /* profile_objecttype */
74.     put_bits(&pb, 4, ctx->sample_rate_index);
        ^
75.     put_bits(&pb, 1, 0);        /* private_bit */
76.     put_bits(&pb, 3, ctx->channel_conf); /* channel_configuration */

libavcodec/bitstream.h:183:1: Parameter `*s->buf_ptr`
  181. 
  182. #ifndef ALT_BITSTREAM_WRITER
  183. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
       ^
  184. {
  185.     unsigned int bit_buf;

libavformat/adtsenc.c:75:5: Call
73.     put_bits(&pb, 2, ctx->objecttype); /* profile_objecttype */
74.     put_bits(&pb, 4, ctx->sample_rate_index);
75.     put_bits(&pb, 1, 0);        /* private_bit */
        ^
76.     put_bits(&pb, 3, ctx->channel_conf); /* channel_configuration */
77.     put_bits(&pb, 1, 0);        /* original_copy */

libavcodec/bitstream.h:183:1: Parameter `*s->buf_ptr`
  181. 
  182. #ifndef ALT_BITSTREAM_WRITER
  183. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
       ^
  184. {
  185.     unsigned int bit_buf;

libavformat/adtsenc.c:76:5: Call
74.     put_bits(&pb, 4, ctx->sample_rate_index);
75.     put_bits(&pb, 1, 0);        /* private_bit */
76.     put_bits(&pb, 3, ctx->channel_conf); /* channel_configuration */
        ^
77.     put_bits(&pb, 1, 0);        /* original_copy */
78.     put_bits(&pb, 1, 0);        /* home */

libavcodec/bitstream.h:183:1: Parameter `*s->buf_ptr`
  181. 
  182. #ifndef ALT_BITSTREAM_WRITER
  183. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
       ^
  184. {
  185.     unsigned int bit_buf;

libavformat/adtsenc.c:77:5: Call
75.     put_bits(&pb, 1, 0);        /* private_bit */
76.     put_bits(&pb, 3, ctx->channel_conf); /* channel_configuration */
77.     put_bits(&pb, 1, 0);        /* original_copy */
        ^
78.     put_bits(&pb, 1, 0);        /* home */
79. 

libavcodec/bitstream.h:183:1: Parameter `*s->buf_ptr`
  181. 
  182. #ifndef ALT_BITSTREAM_WRITER
  183. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
       ^
  184. {
  185.     unsigned int bit_buf;

libavformat/adtsenc.c:78:5: Call
76.     put_bits(&pb, 3, ctx->channel_conf); /* channel_configuration */
77.     put_bits(&pb, 1, 0);        /* original_copy */
78.     put_bits(&pb, 1, 0);        /* home */
        ^
79. 
80.     /* adts_variable_header */

libavcodec/bitstream.h:183:1: Parameter `*s->buf_ptr`
  181. 
  182. #ifndef ALT_BITSTREAM_WRITER
  183. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
       ^
  184. {
  185.     unsigned int bit_buf;

libavformat/adtsenc.c:81:5: Call
79. 
80.     /* adts_variable_header */
81.     put_bits(&pb, 1, 0);        /* copyright_identification_bit */
        ^
82.     put_bits(&pb, 1, 0);        /* copyright_identification_start */
83.     put_bits(&pb, 13, ADTS_HEADER_SIZE + size); /* aac_frame_length */

libavcodec/bitstream.h:183:1: Parameter `*s->buf_ptr`
  181. 
  182. #ifndef ALT_BITSTREAM_WRITER
  183. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
       ^
  184. {
  185.     unsigned int bit_buf;

libavformat/adtsenc.c:82:5: Call
80.     /* adts_variable_header */
81.     put_bits(&pb, 1, 0);        /* copyright_identification_bit */
82.     put_bits(&pb, 1, 0);        /* copyright_identification_start */
        ^
83.     put_bits(&pb, 13, ADTS_HEADER_SIZE + size); /* aac_frame_length */
84.     put_bits(&pb, 11, 0x7ff);   /* adts_buffer_fullness */

libavcodec/bitstream.h:183:1: Parameter `*s->buf_ptr`
  181. 
  182. #ifndef ALT_BITSTREAM_WRITER
  183. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
       ^
  184. {
  185.     unsigned int bit_buf;

libavformat/adtsenc.c:83:5: Call
81.     put_bits(&pb, 1, 0);        /* copyright_identification_bit */
82.     put_bits(&pb, 1, 0);        /* copyright_identification_start */
83.     put_bits(&pb, 13, ADTS_HEADER_SIZE + size); /* aac_frame_length */
        ^
84.     put_bits(&pb, 11, 0x7ff);   /* adts_buffer_fullness */
85.     put_bits(&pb, 2, 0);        /* number_of_raw_data_blocks_in_frame */

libavcodec/bitstream.h:183:1: Parameter `*s->buf_ptr`
  181. 
  182. #ifndef ALT_BITSTREAM_WRITER
  183. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
       ^
  184. {
  185.     unsigned int bit_buf;

libavformat/adtsenc.c:84:5: Call
82.     put_bits(&pb, 1, 0);        /* copyright_identification_start */
83.     put_bits(&pb, 13, ADTS_HEADER_SIZE + size); /* aac_frame_length */
84.     put_bits(&pb, 11, 0x7ff);   /* adts_buffer_fullness */
        ^
85.     put_bits(&pb, 2, 0);        /* number_of_raw_data_blocks_in_frame */
86. 

libavcodec/bitstream.h:183:1: Parameter `*s->buf_ptr`
  181. 
  182. #ifndef ALT_BITSTREAM_WRITER
  183. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
       ^
  184. {
  185.     unsigned int bit_buf;

libavformat/adtsenc.c:85:5: Call
83.     put_bits(&pb, 13, ADTS_HEADER_SIZE + size); /* aac_frame_length */
84.     put_bits(&pb, 11, 0x7ff);   /* adts_buffer_fullness */
85.     put_bits(&pb, 2, 0);        /* number_of_raw_data_blocks_in_frame */
        ^
86. 
87.     flush_put_bits(&pb);

libavcodec/bitstream.h:183:1: <Length trace>
181. 
182. #ifndef ALT_BITSTREAM_WRITER
183. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
     ^
184. {
185.     unsigned int bit_buf;

libavcodec/bitstream.h:183:1: Parameter `*s->buf_ptr`
  181. 
  182. #ifndef ALT_BITSTREAM_WRITER
  183. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
       ^
  184. {
  185.     unsigned int bit_buf;

libavcodec/bitstream.h:225:13: Array access: Offset: [3, 59] (⇐ [0, 56] + 3) Size: 7 by call to `put_bits` 
  223.             s->buf_ptr[1] = bit_buf >> 16;
  224.             s->buf_ptr[2] = bit_buf >>  8;
  225.             s->buf_ptr[3] = bit_buf      ;
                   ^
  226.         } else
  227. #endif
