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

libavcodec/cook.c:961:5: Assignment
959.     int i, ret;
960.     int offset = 0;
961.     int chidx = 0;
         ^
962. 
963.     if (buf_size < avctx->block_align)

libavcodec/cook.c:993:9: Assignment
991.         q->subpacket[i].bits_per_subpacket = (q->subpacket[i].size * 8) >>
992.                                               q->subpacket[i].bits_per_subpdiv;
993.         q->subpacket[i].ch_idx = chidx;
             ^
994.         av_log(avctx, AV_LOG_DEBUG,
995.                "subpacket[%i] size %i js %i %i block_align %i\n",

libavcodec/cook.c:999:9: Call
 997.                avctx->block_align);
 998. 
 999.         decode_subpacket(q, &q->subpacket[i], buf + offset, samples);
              ^
1000.         offset += q->subpacket[i].size;
1001.         chidx += q->subpacket[i].num_channels;

libavcodec/cook.c:912:1: Parameter `p->subbands`
  910.  * @param outbuffer         pointer to the outbuffer
  911.  */
  912. static void decode_subpacket(COOKContext *q, COOKSubpacket *p,
       ^
  913.                              const uint8_t *inbuffer, float *outbuffer)
  914. {

libavcodec/cook.c:924:9: Call
  922. 
  923.     if (p->joint_stereo) {
  924.         joint_decode(q, p, q->decode_buffer_1, q->decode_buffer_2);
               ^
  925.     } else {
  926.         mono_decode(q, p, q->decode_buffer_1);

libavcodec/cook.c:801:1: Parameter `p->subbands`
    799.  * @param mlt_buffer2       pointer to right channel mlt coefficients
    800.  */
    801. static void joint_decode(COOKContext *q, COOKSubpacket *p, float *mlt_buffer1,
         ^
    802.                          float *mlt_buffer2)
    803. {

libavcodec/cook.c:817:5: Call
    815.     memset(mlt_buffer1, 0, 1024 * sizeof(*mlt_buffer1));
    816.     memset(mlt_buffer2, 0, 1024 * sizeof(*mlt_buffer2));
    817.     decouple_info(q, p, decouple_tab);
             ^
    818.     mono_decode(q, p, decode_buffer);
    819. 

libavcodec/cook.c:749:1: <Offset trace>
747.  *
748.  */
749. static void decouple_info(COOKContext *q, COOKSubpacket *p, int *decouple_tab)
     ^
750. {
751.     int i;

libavcodec/cook.c:749:1: Parameter `p->subbands`
      747.  *
      748.  */
      749. static void decouple_info(COOKContext *q, COOKSubpacket *p, int *decouple_tab)
           ^
      750. {
      751.     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:754:18: Array access: Offset: -1 Size: 51 by call to `decode_subpacket` 
      752.     int vlc    = get_bits1(&q->gb);
      753.     int start  = cplband[p->js_subband_start];
      754.     int end    = cplband[p->subbands - 1];
                            ^
      755.     int length = end - start + 1;
      756. 
