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

libavcodec/cook.c:955:5: Assignment
953.     int i, ret;
954.     int offset = 0;
955.     int chidx = 0;
         ^
956. 
957.     if (buf_size < avctx->block_align)

libavcodec/cook.c:987:9: Assignment
985.         q->subpacket[i].bits_per_subpacket = (q->subpacket[i].size * 8) >>
986.                                               q->subpacket[i].bits_per_subpdiv;
987.         q->subpacket[i].ch_idx = chidx;
             ^
988.         av_log(avctx, AV_LOG_DEBUG,
989.                "subpacket[%i] size %i js %i %i block_align %i\n",

libavcodec/cook.c:993:20: Call
991.                avctx->block_align);
992. 
993.         if ((ret = decode_subpacket(q, &q->subpacket[i], buf + offset, samples)) < 0)
                        ^
994.             return ret;
995.         offset += q->subpacket[i].size;

libavcodec/cook.c:904:1: Parameter `p->subbands`
  902.  * @param outbuffer         pointer to the outbuffer
  903.  */
  904. static int decode_subpacket(COOKContext *q, COOKSubpacket *p,
       ^
  905.                             const uint8_t *inbuffer, float **outbuffer)
  906. {

libavcodec/cook.c:914:20: Call
  912. 
  913.     if (p->joint_stereo) {
  914.         if ((res = joint_decode(q, p, q->decode_buffer_1, q->decode_buffer_2)) < 0)
                          ^
  915.             return res;
  916.     } else {

libavcodec/cook.c:794:1: Parameter `p->subbands`
    792.  * @param mlt_buffer2       pointer to right channel mlt coefficients
    793.  */
    794. static int joint_decode(COOKContext *q, COOKSubpacket *p,
         ^
    795.                         float *mlt_buffer_left, float *mlt_buffer_right)
    796. {

libavcodec/cook.c:809:5: Call
    807.     memset(mlt_buffer_left,  0, 1024 * sizeof(*mlt_buffer_left));
    808.     memset(mlt_buffer_right, 0, 1024 * sizeof(*mlt_buffer_right));
    809.     decouple_info(q, p, decouple_tab);
             ^
    810.     if ((res = mono_decode(q, p, decode_buffer)) < 0)
    811.         return res;

libavcodec/cook.c:739:1: <Offset trace>
737.  * @param decouple_tab      decoupling array
738.  */
739. static void decouple_info(COOKContext *q, COOKSubpacket *p, int *decouple_tab)
     ^
740. {
741.     int i;

libavcodec/cook.c:739:1: Parameter `p->subbands`
      737.  * @param decouple_tab      decoupling array
      738.  */
      739. static void decouple_info(COOKContext *q, COOKSubpacket *p, int *decouple_tab)
           ^
      740. {
      741.     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:744:18: Array access: Offset: -1 Size: 51 by call to `decode_subpacket` 
      742.     int vlc    = bitstream_read_bit(&q->bc);
      743.     int start  = cplband[p->js_subband_start];
      744.     int end    = cplband[p->subbands - 1];
                            ^
      745.     int length = end - start + 1;
      746. 
