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

libavcodec/cook.c:1002:5: Assignment
1000.     int i;
1001.     int offset = 0;
1002.     int chidx = 0;
          ^
1003. 
1004.     if (buf_size < avctx->block_align)

libavcodec/cook.c:1023:9: Assignment
1021.     for(i=0;i<q->num_subpackets;i++){
1022.         q->subpacket[i].bits_per_subpacket = (q->subpacket[i].size*8)>>q->subpacket[i].bits_per_subpdiv;
1023.         q->subpacket[i].ch_idx = chidx;
              ^
1024.         av_log(avctx,AV_LOG_DEBUG,"subpacket[%i] size %i js %i %i block_align %i\n",i,q->subpacket[i].size,q->subpacket[i].joint_stereo,offset,avctx->block_align);
1025.         decode_subpacket(q, &q->subpacket[i], buf + offset, (int16_t*)data);

libavcodec/cook.c:1025:9: Call
1023.         q->subpacket[i].ch_idx = chidx;
1024.         av_log(avctx,AV_LOG_DEBUG,"subpacket[%i] size %i js %i %i block_align %i\n",i,q->subpacket[i].size,q->subpacket[i].joint_stereo,offset,avctx->block_align);
1025.         decode_subpacket(q, &q->subpacket[i], buf + offset, (int16_t*)data);
              ^
1026.         offset += q->subpacket[i].size;
1027.         chidx += q->subpacket[i].num_channels;

libavcodec/cook.c:951:1: Parameter `p->subbands`
  949.  * @param outbuffer         pointer to the outbuffer
  950.  */
  951. static void decode_subpacket(COOKContext *q, COOKSubpacket* p, const uint8_t *inbuffer, int16_t *outbuffer) {
       ^
  952.     int sub_packet_size = p->size;
  953.     /* packet dump */

libavcodec/cook.c:962:9: Call
  960. 
  961.     if (p->joint_stereo) {
  962.         joint_decode(q, p, q->decode_buffer_1, q->decode_buffer_2);
               ^
  963.     } else {
  964.         mono_decode(q, p, q->decode_buffer_1);

libavcodec/cook.c:835:1: Parameter `p->subbands`
    833.  */
    834. 
    835. static void joint_decode(COOKContext *q, COOKSubpacket *p, float* mlt_buffer1,
         ^
    836.                          float* mlt_buffer2) {
    837.     int i,j;

libavcodec/cook.c:850:5: Call
    848.     memset(mlt_buffer1,0, 1024*sizeof(float));
    849.     memset(mlt_buffer2,0, 1024*sizeof(float));
    850.     decouple_info(q, p, decouple_tab);
             ^
    851.     mono_decode(q, p, decode_buffer);
    852. 

libavcodec/cook.c:779:1: <Offset trace>
777.  */
778. 
779. static void decouple_info(COOKContext *q, COOKSubpacket *p, int* decouple_tab){
     ^
780.     int length, i;
781. 

libavcodec/cook.c:779:1: Parameter `p->subbands`
      777.  */
      778. 
      779. static void decouple_info(COOKContext *q, COOKSubpacket *p, int* decouple_tab){
           ^
      780.     int length, i;
      781. 

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:783:43: Array access: Offset: -1 Size: 51 by call to `decode_subpacket` 
      781. 
      782.     if(get_bits1(&q->gb)) {
      783.         if(cplband[p->js_subband_start] > cplband[p->subbands-1]) return;
                                                     ^
      784. 
      785.         length = cplband[p->subbands-1] - cplband[p->js_subband_start] + 1;
