libavcodec/4xm.c:572: error: Uninitialized Value
  The value read from flag[_] was never initialized.

libavcodec/4xm.c:572:13: 
570. 
571.         for(node= j; up[node] != -1; node= up[node]){
572.             bits += flag[node]<<len;
                 ^
573.             len++;
574.             if(len > 31) av_log(f->avctx, AV_LOG_ERROR, "vlc length overflow\n"); //can this happen at all ?

static const uint8_t *read_huffman_tables(FourXContext *f, const uint8_t * const buf){
    int frequency[512];
    uint8_t flag[512];
    int up[512];
    uint8_t len_tab[257];
    int bits_tab[257];
    int start, end;
    const uint8_t *ptr= buf;
    int j;
    memset(frequency, 0, sizeof(frequency));
    memset(up, -1, sizeof(up));
    start= *ptr++;
    end= *ptr++;
    for(;;){
        int i;
        for(i=start; i<=end; i++){
            frequency[i]= *ptr++;
        }
        start= *ptr++;
        if(start==0) break;
        end= *ptr++;
    }
    frequency[256]=1;
    while((ptr - buf)&3) ptr++;
    for(j=257; j<512; j++){
        int min_freq[2]= {256*256, 256*256};
        int smallest[2]= {0, 0};
        int i;
        for(i=0; i<j; i++){
            if(frequency[i] == 0) continue;
            if(frequency[i] < min_freq[1]){
                if(frequency[i] < min_freq[0]){
                    min_freq[1]= min_freq[0]; smallest[1]= smallest[0];
                    min_freq[0]= frequency[i];smallest[0]= i;
                }else{
                    min_freq[1]= frequency[i];smallest[1]= i;
                }
            }
        }
        if(min_freq[1] == 256*256) break;
        frequency[j]= min_freq[0] + min_freq[1];
        flag[ smallest[0] ]= 0;
        flag[ smallest[1] ]= 1;
        up[ smallest[0] ]=
        up[ smallest[1] ]= j;
        frequency[ smallest[0] ]= frequency[ smallest[1] ]= 0;
    }
    for(j=0; j<257; j++){
        int node;
        int len=0;
        int bits=0;
        for(node= j; up[node] != -1; node= up[node]){
            bits += flag[node]<<len;
            len++;
            if(len > 31) av_log(f->avctx, AV_LOG_ERROR, "vlc length overflow\n");
        }
        bits_tab[j]= bits;
        len_tab[j]= len;
    }
    init_vlc(&f->pre_vlc, ACDC_VLC_BITS, 257,
             len_tab , 1, 1,
             bits_tab, 4, 4, 0);
    return ptr;
}
['static const uint8_t *read_huffman_tables(FourXContext *f, const uint8_t * const buf){\n    int frequency[512];\n    uint8_t flag[512];\n    int up[512];\n    uint8_t len_tab[257];\n    int bits_tab[257];\n    int start, end;\n    const uint8_t *ptr= buf;\n    int j;\n    memset(frequency, 0, sizeof(frequency));\n    memset(up, -1, sizeof(up));\n    start= *ptr++;\n    end= *ptr++;\n    for(;;){\n        int i;\n        for(i=start; i<=end; i++){\n            frequency[i]= *ptr++;\n        }\n        start= *ptr++;\n        if(start==0) break;\n        end= *ptr++;\n    }\n    frequency[256]=1;\n    while((ptr - buf)&3) ptr++;\n    for(j=257; j<512; j++){\n        int min_freq[2]= {256*256, 256*256};\n        int smallest[2]= {0, 0};\n        int i;\n        for(i=0; i<j; i++){\n            if(frequency[i] == 0) continue;\n            if(frequency[i] < min_freq[1]){\n                if(frequency[i] < min_freq[0]){\n                    min_freq[1]= min_freq[0]; smallest[1]= smallest[0];\n                    min_freq[0]= frequency[i];smallest[0]= i;\n                }else{\n                    min_freq[1]= frequency[i];smallest[1]= i;\n                }\n            }\n        }\n        if(min_freq[1] == 256*256) break;\n        frequency[j]= min_freq[0] + min_freq[1];\n        flag[ smallest[0] ]= 0;\n        flag[ smallest[1] ]= 1;\n        up[ smallest[0] ]=\n        up[ smallest[1] ]= j;\n        frequency[ smallest[0] ]= frequency[ smallest[1] ]= 0;\n    }\n    for(j=0; j<257; j++){\n        int node;\n        int len=0;\n        int bits=0;\n        for(node= j; up[node] != -1; node= up[node]){\n            bits += flag[node]<<len;\n            len++;\n            if(len > 31) av_log(f->avctx, AV_LOG_ERROR, "vlc length overflow\\n");\n        }\n        bits_tab[j]= bits;\n        len_tab[j]= len;\n    }\n    init_vlc(&f->pre_vlc, ACDC_VLC_BITS, 257,\n             len_tab , 1, 1,\n             bits_tab, 4, 4, 0);\n    return ptr;\n}']