libavcodec/huffyuv.c:350: error: Buffer Overrun L2
  Offset: [0, 257] (⇐ [0, 2] + [0, 255]) Size: 3 by call to `generate_bits_table`.

libavcodec/huffyuv.c:341:1: Parameter `s->len[*]`
339. }
340. 
341. static int read_huffman_tables(HYuvContext *s, const uint8_t *src, int length){
     ^
342.     GetBitContext gb;
343.     int i;

libavcodec/huffyuv.c:350:12: Call
348.         if(read_len_table(s->len[i], &gb)<0)
349.             return -1;
350.         if(generate_bits_table(s->bits[i], s->len[i])<0){
                ^
351.             return -1;
352.         }

libavcodec/huffyuv.c:201:13: <Offset trace>
199. 
200.     for(len=32; len>0; len--){
201.         for(index=0; index<256; index++){
                 ^
202.             if(len_table[index]==len)
203.                 dst[index]= bits++;

libavcodec/huffyuv.c:201:13: Assignment
  199. 
  200.     for(len=32; len>0; len--){
  201.         for(index=0; index<256; index++){
                   ^
  202.             if(len_table[index]==len)
  203.                 dst[index]= bits++;

libavcodec/huffyuv.c:196:1: <Length trace>
194. }
195. 
196. static int generate_bits_table(uint32_t *dst, const uint8_t *len_table){
     ^
197.     int len, index;
198.     uint32_t bits=0;

libavcodec/huffyuv.c:196:1: Parameter `*len_table`
  194. }
  195. 
  196. static int generate_bits_table(uint32_t *dst, const uint8_t *len_table){
       ^
  197.     int len, index;
  198.     uint32_t bits=0;

libavcodec/huffyuv.c:202:16: Array access: Offset: [0, 257] (⇐ [0, 2] + [0, 255]) Size: 3 by call to `generate_bits_table` 
  200.     for(len=32; len>0; len--){
  201.         for(index=0; index<256; index++){
  202.             if(len_table[index]==len)
                      ^
  203.                 dst[index]= bits++;
  204.         }

static int generate_bits_table(uint32_t *dst, const uint8_t *len_table){
    int len, index;
    uint32_t bits=0;
    for(len=32; len>0; len--){
        for(index=0; index<256; index++){
            if(len_table[index]==len)
                dst[index]= bits++;
        }
        if(bits & 1){
            av_log(NULL, AV_LOG_ERROR, "Error generating huffman table\n");
            return -1;
        }
        bits >>= 1;
    }
    return 0;
}
['static int read_huffman_tables(HYuvContext *s, const uint8_t *src, int length){\n    GetBitContext gb;\n    int i;\n    init_get_bits(&gb, src, length*8);\n    for(i=0; i<3; i++){\n        if(read_len_table(s->len[i], &gb)<0)\n            return -1;\n        if(generate_bits_table(s->bits[i], s->len[i])<0){\n            return -1;\n        }\n#if 0\nfor(j=0; j<256; j++){\nprintf("%6X, %2d,  %3d\\n", s->bits[i][j], s->len[i][j], j);\n}\n#endif\n        free_vlc(&s->vlc[i]);\n        init_vlc(&s->vlc[i], VLC_BITS, 256, s->len[i], 1, 1, s->bits[i], 4, 4, 0);\n    }\n    generate_joint_tables(s);\n    return (get_bits_count(&gb)+7)/8;\n}', 'static int generate_bits_table(uint32_t *dst, const uint8_t *len_table){\n    int len, index;\n    uint32_t bits=0;\n    for(len=32; len>0; len--){\n        for(index=0; index<256; index++){\n            if(len_table[index]==len)\n                dst[index]= bits++;\n        }\n        if(bits & 1){\n            av_log(NULL, AV_LOG_ERROR, "Error generating huffman table\\n");\n            return -1;\n        }\n        bits >>= 1;\n    }\n    return 0;\n}']