libavformat/movenc.c:263: error: Buffer Overrun L2
  Offset: [2, 26] (⇐ [0, 24] + 2) Size: 3 by call to `put_bits`.

libavformat/movenc.c:227:1: Array declaration
225. }
226. 
227. static int mov_write_ac3_tag(ByteIOContext *pb, MOVTrack *track)
     ^
228. {
229.     GetBitContext gbc;

libavformat/movenc.c:256:5: Call
254.     lfeon = get_bits1(&gbc);
255. 
256.     init_put_bits(&pbc, buf, sizeof(buf));
         ^
257.     put_bits(&pbc, 2, fscod);
258.     put_bits(&pbc, 5, bsid);

libavcodec/put_bits.h:60:1: Parameter `*buffer`
  58.  * @param buffer_size the size in bytes of \p buffer
  59.  */
  60. static inline void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
      ^
  61. {
  62.     if(buffer_size < 0) {

libavcodec/put_bits.h:68:5: Assignment
  66. 
  67.     s->size_in_bits= 8*buffer_size;
  68.     s->buf = buffer;
          ^
  69.     s->buf_end = s->buf + buffer_size;
  70. #ifdef ALT_BITSTREAM_WRITER

libavcodec/put_bits.h:75:5: Assignment
  73. //    memset(buffer, 0, buffer_size);
  74. #else
  75.     s->buf_ptr = s->buf;
          ^
  76.     s->bit_left=32;
  77.     s->bit_buf=0;

libavformat/movenc.c:257:5: Call
255. 
256.     init_put_bits(&pbc, buf, sizeof(buf));
257.     put_bits(&pbc, 2, fscod);
         ^
258.     put_bits(&pbc, 5, bsid);
259.     put_bits(&pbc, 3, bsmod);

libavcodec/put_bits.h:139:1: Parameter `*s->buf_ptr`
  137. void ff_copy_bits(PutBitContext *pb, const uint8_t *src, int length);
  138. 
  139. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
       ^
  140. #ifndef ALT_BITSTREAM_WRITER
  141. {

libavformat/movenc.c:258:5: Call
256.     init_put_bits(&pbc, buf, sizeof(buf));
257.     put_bits(&pbc, 2, fscod);
258.     put_bits(&pbc, 5, bsid);
         ^
259.     put_bits(&pbc, 3, bsmod);
260.     put_bits(&pbc, 3, acmod);

libavcodec/put_bits.h:139:1: Parameter `*s->buf_ptr`
  137. void ff_copy_bits(PutBitContext *pb, const uint8_t *src, int length);
  138. 
  139. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
       ^
  140. #ifndef ALT_BITSTREAM_WRITER
  141. {

libavformat/movenc.c:259:5: Call
257.     put_bits(&pbc, 2, fscod);
258.     put_bits(&pbc, 5, bsid);
259.     put_bits(&pbc, 3, bsmod);
         ^
260.     put_bits(&pbc, 3, acmod);
261.     put_bits(&pbc, 1, lfeon);

libavcodec/put_bits.h:139:1: Parameter `*s->buf_ptr`
  137. void ff_copy_bits(PutBitContext *pb, const uint8_t *src, int length);
  138. 
  139. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
       ^
  140. #ifndef ALT_BITSTREAM_WRITER
  141. {

libavformat/movenc.c:260:5: Call
258.     put_bits(&pbc, 5, bsid);
259.     put_bits(&pbc, 3, bsmod);
260.     put_bits(&pbc, 3, acmod);
         ^
261.     put_bits(&pbc, 1, lfeon);
262.     put_bits(&pbc, 5, frmsizecod>>1); // bit_rate_code

libavcodec/put_bits.h:139:1: Parameter `*s->buf_ptr`
  137. void ff_copy_bits(PutBitContext *pb, const uint8_t *src, int length);
  138. 
  139. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
       ^
  140. #ifndef ALT_BITSTREAM_WRITER
  141. {

libavformat/movenc.c:261:5: Call
259.     put_bits(&pbc, 3, bsmod);
260.     put_bits(&pbc, 3, acmod);
261.     put_bits(&pbc, 1, lfeon);
         ^
262.     put_bits(&pbc, 5, frmsizecod>>1); // bit_rate_code
263.     put_bits(&pbc, 5, 0); // reserved

libavcodec/put_bits.h:139:1: Parameter `*s->buf_ptr`
  137. void ff_copy_bits(PutBitContext *pb, const uint8_t *src, int length);
  138. 
  139. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
       ^
  140. #ifndef ALT_BITSTREAM_WRITER
  141. {

libavformat/movenc.c:262:5: Call
260.     put_bits(&pbc, 3, acmod);
261.     put_bits(&pbc, 1, lfeon);
262.     put_bits(&pbc, 5, frmsizecod>>1); // bit_rate_code
         ^
263.     put_bits(&pbc, 5, 0); // reserved
264. 

libavcodec/put_bits.h:139:1: Parameter `*s->buf_ptr`
  137. void ff_copy_bits(PutBitContext *pb, const uint8_t *src, int length);
  138. 
  139. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
       ^
  140. #ifndef ALT_BITSTREAM_WRITER
  141. {

libavformat/movenc.c:263:5: Call
261.     put_bits(&pbc, 1, lfeon);
262.     put_bits(&pbc, 5, frmsizecod>>1); // bit_rate_code
263.     put_bits(&pbc, 5, 0); // reserved
         ^
264. 
265.     flush_put_bits(&pbc);

libavcodec/put_bits.h:139:1: <Length trace>
137. void ff_copy_bits(PutBitContext *pb, const uint8_t *src, int length);
138. 
139. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
     ^
140. #ifndef ALT_BITSTREAM_WRITER
141. {

libavcodec/put_bits.h:139:1: Parameter `*s->buf_ptr`
  137. void ff_copy_bits(PutBitContext *pb, const uint8_t *src, int length);
  138. 
  139. static inline void put_bits(PutBitContext *s, int n, unsigned int value)
       ^
  140. #ifndef ALT_BITSTREAM_WRITER
  141. {

libavcodec/put_bits.h:176:13: Array access: Offset: [2, 26] (⇐ [0, 24] + 2) Size: 3 by call to `put_bits` 
  174. #if !HAVE_FAST_UNALIGNED
  175.         if (3 & (intptr_t) s->buf_ptr) {
  176.             AV_WB32(s->buf_ptr, bit_buf);
                   ^
  177.         } else
  178. #endif

static inline void put_bits(PutBitContext *s, int n, unsigned int value)
#ifndef ALT_BITSTREAM_WRITER
{
    unsigned int bit_buf;
    int bit_left;
    assert(n == 32 || value < (1U << n));
    bit_buf = s->bit_buf;
    bit_left = s->bit_left;
#ifdef BITSTREAM_WRITER_LE
    bit_buf |= value << (32 - bit_left);
    if (n >= bit_left) {
#if !HAVE_FAST_UNALIGNED
        if (3 & (intptr_t) s->buf_ptr) {
            AV_WL32(s->buf_ptr, bit_buf);
        } else
#endif
        *(uint32_t *)s->buf_ptr = le2me_32(bit_buf);
        s->buf_ptr+=4;
        bit_buf = (bit_left==32)?0:value >> bit_left;
        bit_left+=32;
    }
    bit_left-=n;
#else
    if (n < bit_left) {
        bit_buf = (bit_buf<<n) | value;
        bit_left-=n;
    } else {
        bit_buf<<=bit_left;
        bit_buf |= value >> (n - bit_left);
#if !HAVE_FAST_UNALIGNED
        if (3 & (intptr_t) s->buf_ptr) {
            AV_WB32(s->buf_ptr, bit_buf);
        } else
#endif
        *(uint32_t *)s->buf_ptr = be2me_32(bit_buf);
        s->buf_ptr+=4;
        bit_left+=32 - n;
        bit_buf = value;
    }
#endif
    s->bit_buf = bit_buf;
    s->bit_left = bit_left;
}
['static int mov_write_ac3_tag(ByteIOContext *pb, MOVTrack *track)\n{\n    GetBitContext gbc;\n    PutBitContext pbc;\n    uint8_t buf[3];\n    int fscod, bsid, bsmod, acmod, lfeon, frmsizecod;\n    if (track->vosLen < 7)\n        return -1;\n    put_be32(pb, 11);\n    put_tag(pb, "dac3");\n    init_get_bits(&gbc, track->vosData+4, track->vosLen-4);\n    fscod      = get_bits(&gbc, 2);\n    frmsizecod = get_bits(&gbc, 6);\n    bsid       = get_bits(&gbc, 5);\n    bsmod      = get_bits(&gbc, 3);\n    acmod      = get_bits(&gbc, 3);\n    if (acmod == 2) {\n        skip_bits(&gbc, 2);\n    } else {\n        if ((acmod & 1) && acmod != 1)\n            skip_bits(&gbc, 2);\n        if (acmod & 4)\n            skip_bits(&gbc, 2);\n    }\n    lfeon = get_bits1(&gbc);\n    init_put_bits(&pbc, buf, sizeof(buf));\n    put_bits(&pbc, 2, fscod);\n    put_bits(&pbc, 5, bsid);\n    put_bits(&pbc, 3, bsmod);\n    put_bits(&pbc, 3, acmod);\n    put_bits(&pbc, 1, lfeon);\n    put_bits(&pbc, 5, frmsizecod>>1);\n    put_bits(&pbc, 5, 0);\n    flush_put_bits(&pbc);\n    put_buffer(pb, buf, sizeof(buf));\n    return 11;\n}', 'static inline void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)\n{\n    if(buffer_size < 0) {\n        buffer_size = 0;\n        buffer = NULL;\n    }\n    s->size_in_bits= 8*buffer_size;\n    s->buf = buffer;\n    s->buf_end = s->buf + buffer_size;\n#ifdef ALT_BITSTREAM_WRITER\n    s->index=0;\n    ((uint32_t*)(s->buf))[0]=0;\n#else\n    s->buf_ptr = s->buf;\n    s->bit_left=32;\n    s->bit_buf=0;\n#endif\n}', 'static inline void put_bits(PutBitContext *s, int n, unsigned int value)\n#ifndef ALT_BITSTREAM_WRITER\n{\n    unsigned int bit_buf;\n    int bit_left;\n    assert(n == 32 || value < (1U << n));\n    bit_buf = s->bit_buf;\n    bit_left = s->bit_left;\n#ifdef BITSTREAM_WRITER_LE\n    bit_buf |= value << (32 - bit_left);\n    if (n >= bit_left) {\n#if !HAVE_FAST_UNALIGNED\n        if (3 & (intptr_t) s->buf_ptr) {\n            AV_WL32(s->buf_ptr, bit_buf);\n        } else\n#endif\n        *(uint32_t *)s->buf_ptr = le2me_32(bit_buf);\n        s->buf_ptr+=4;\n        bit_buf = (bit_left==32)?0:value >> bit_left;\n        bit_left+=32;\n    }\n    bit_left-=n;\n#else\n    if (n < bit_left) {\n        bit_buf = (bit_buf<<n) | value;\n        bit_left-=n;\n    } else {\n        bit_buf<<=bit_left;\n        bit_buf |= value >> (n - bit_left);\n#if !HAVE_FAST_UNALIGNED\n        if (3 & (intptr_t) s->buf_ptr) {\n            AV_WB32(s->buf_ptr, bit_buf);\n        } else\n#endif\n        *(uint32_t *)s->buf_ptr = be2me_32(bit_buf);\n        s->buf_ptr+=4;\n        bit_left+=32 - n;\n        bit_buf = value;\n    }\n#endif\n    s->bit_buf = bit_buf;\n    s->bit_left = bit_left;\n}']