libavcodec/cook.c:1011: error: Buffer Overrun L1
  Offset: -1 Size: 51 by call to `decode_subpacket`.

libavcodec/cook.c:973:5: Assignment
971.     int i, ret;
972.     int offset = 0;
973.     int chidx = 0;
         ^
974. 
975.     if (buf_size < avctx->block_align)

libavcodec/cook.c:1005:9: Assignment
1003.         q->subpacket[i].bits_per_subpacket = (q->subpacket[i].size * 8) >>
1004.                                               q->subpacket[i].bits_per_subpdiv;
1005.         q->subpacket[i].ch_idx = chidx;
              ^
1006.         av_log(avctx, AV_LOG_DEBUG,
1007.                "subpacket[%i] size %i js %i %i block_align %i\n",

libavcodec/cook.c:1011:20: Call
1009.                avctx->block_align);
1010. 
1011.         if ((ret = decode_subpacket(q, &q->subpacket[i], buf + offset, samples)) < 0)
                         ^
1012.             return ret;
1013.         offset += q->subpacket[i].size;

libavcodec/cook.c:918:1: Parameter `p->subbands`
  916.  * @param outbuffer         pointer to the outbuffer
  917.  */
  918. static int decode_subpacket(COOKContext *q, COOKSubpacket *p,
       ^
  919.                             const uint8_t *inbuffer, float **outbuffer)
  920. {

libavcodec/cook.c:928:20: Call
  926. 
  927.     if (p->joint_stereo) {
  928.         if ((res = joint_decode(q, p, q->decode_buffer_1, q->decode_buffer_2)) < 0)
                          ^
  929.             return res;
  930.     } else {

libavcodec/cook.c:809:1: Parameter `p->subbands`
    807.  * @param mlt_buffer2       pointer to right channel mlt coefficients
    808.  */
    809. static int joint_decode(COOKContext *q, COOKSubpacket *p, float *mlt_buffer1,
         ^
    810.                         float *mlt_buffer2)
    811. {

libavcodec/cook.c:824:5: Call
    822.     memset(mlt_buffer1, 0, 1024 * sizeof(*mlt_buffer1));
    823.     memset(mlt_buffer2, 0, 1024 * sizeof(*mlt_buffer2));
    824.     decouple_info(q, p, decouple_tab);
             ^
    825.     if ((res = mono_decode(q, p, decode_buffer)) < 0)
    826.         return res;

libavcodec/cook.c:757:1: <Offset trace>
755.  *
756.  */
757. static void decouple_info(COOKContext *q, COOKSubpacket *p, int *decouple_tab)
     ^
758. {
759.     int i;

libavcodec/cook.c:757:1: Parameter `p->subbands`
      755.  *
      756.  */
      757. static void decouple_info(COOKContext *q, COOKSubpacket *p, int *decouple_tab)
           ^
      758. {
      759.     int i;

libavcodec/cookdata.h:504:1: <Length trace>
502. //Coupling tables
503. 
504. static const int cplband[51] = {
     ^
505.     0,1,2,3,4,5,6,7,8,9,
506.     10,11,11,12,12,13,13,14,14,14,

libavcodec/cookdata.h:504:1: Array declaration
      502. //Coupling tables
      503. 
      504. static const int cplband[51] = {
           ^
      505.     0,1,2,3,4,5,6,7,8,9,
      506.     10,11,11,12,12,13,13,14,14,14,

libavcodec/cook.c:762:18: Array access: Offset: -1 Size: 51 by call to `decode_subpacket` 
      760.     int vlc    = get_bits1(&q->gb);
      761.     int start  = cplband[p->js_subband_start];
      762.     int end    = cplband[p->subbands - 1];
                            ^
      763.     int length = end - start + 1;
      764. 
