libavcodec/error_resilience.c:419: error: Uninitialized Value
  The value read from fixed[_] was never initialized.

libavcodec/error_resilience.c:419:34: 
417.                         pred_count++;
418.                     }
419.                     if(mb_y>0 && fixed[mb_xy-mb_stride]){
                                      ^
420.                         mv_predictor[pred_count][0]= s->current_picture.motion_val[0][mot_index - mot_stride*2][0];
421.                         mv_predictor[pred_count][1]= s->current_picture.motion_val[0][mot_index - mot_stride*2][1];

static void guess_mv(MpegEncContext *s){
    uint8_t fixed[s->mb_stride * s->mb_height];
#define MV_FROZEN    3
#define MV_CHANGED   2
#define MV_UNCHANGED 1
    const int mb_stride = s->mb_stride;
    const int mb_width = s->mb_width;
    const int mb_height= s->mb_height;
    int i, depth, num_avail;
    int mb_x, mb_y;
    num_avail=0;
    for(i=0; i<s->mb_num; i++){
        const int mb_xy= s->mb_index2xy[ i ];
        int f=0;
        int error= s->error_status_table[mb_xy];
        if(IS_INTRA(s->current_picture.mb_type[mb_xy])) f=MV_FROZEN;
        if(!(error&MV_ERROR)) f=MV_FROZEN;
        fixed[mb_xy]= f;
        if(f==MV_FROZEN)
            num_avail++;
    }
    if((!(s->avctx->error_concealment&FF_EC_GUESS_MVS)) || num_avail <= mb_width/2){
        for(mb_y=0; mb_y<s->mb_height; mb_y++){
            for(mb_x=0; mb_x<s->mb_width; mb_x++){
                const int mb_xy= mb_x + mb_y*s->mb_stride;
                if(IS_INTRA(s->current_picture.mb_type[mb_xy]))  continue;
                if(!(s->error_status_table[mb_xy]&MV_ERROR)) continue;
                s->mv_dir = MV_DIR_FORWARD;
                s->mb_intra=0;
                s->mv_type = MV_TYPE_16X16;
                s->mb_skipped=0;
                s->dsp.clear_blocks(s->block[0]);
                s->mb_x= mb_x;
                s->mb_y= mb_y;
                s->mv[0][0][0]= 0;
                s->mv[0][0][1]= 0;
                decode_mb(s);
            }
        }
        return;
    }
    for(depth=0;; depth++){
        int changed, pass, none_left;
        none_left=1;
        changed=1;
        for(pass=0; (changed || pass<2) && pass<10; pass++){
            int mb_x, mb_y;
int score_sum=0;
            changed=0;
            for(mb_y=0; mb_y<s->mb_height; mb_y++){
                for(mb_x=0; mb_x<s->mb_width; mb_x++){
                    const int mb_xy= mb_x + mb_y*s->mb_stride;
                    int mv_predictor[8][2]={{0}};
                    int pred_count=0;
                    int j;
                    int best_score=256*256*256*64;
                    int best_pred=0;
                    const int mot_stride= s->b8_stride;
                    const int mot_index= mb_x*2 + mb_y*2*mot_stride;
                    int prev_x= s->current_picture.motion_val[0][mot_index][0];
                    int prev_y= s->current_picture.motion_val[0][mot_index][1];
                    if((mb_x^mb_y^pass)&1) continue;
                    if(fixed[mb_xy]==MV_FROZEN) continue;
                    assert(!IS_INTRA(s->current_picture.mb_type[mb_xy]));
                    assert(s->last_picture_ptr && s->last_picture_ptr->data[0]);
                    j=0;
                    if(mb_x>0           && fixed[mb_xy-1        ]==MV_FROZEN) j=1;
                    if(mb_x+1<mb_width  && fixed[mb_xy+1        ]==MV_FROZEN) j=1;
                    if(mb_y>0           && fixed[mb_xy-mb_stride]==MV_FROZEN) j=1;
                    if(mb_y+1<mb_height && fixed[mb_xy+mb_stride]==MV_FROZEN) j=1;
                    if(j==0) continue;
                    j=0;
                    if(mb_x>0           && fixed[mb_xy-1        ]==MV_CHANGED) j=1;
                    if(mb_x+1<mb_width  && fixed[mb_xy+1        ]==MV_CHANGED) j=1;
                    if(mb_y>0           && fixed[mb_xy-mb_stride]==MV_CHANGED) j=1;
                    if(mb_y+1<mb_height && fixed[mb_xy+mb_stride]==MV_CHANGED) j=1;
                    if(j==0 && pass>1) continue;
                    none_left=0;
                    if(mb_x>0 && fixed[mb_xy-1]){
                        mv_predictor[pred_count][0]= s->current_picture.motion_val[0][mot_index - 2][0];
                        mv_predictor[pred_count][1]= s->current_picture.motion_val[0][mot_index - 2][1];
                        pred_count++;
                    }
                    if(mb_x+1<mb_width && fixed[mb_xy+1]){
                        mv_predictor[pred_count][0]= s->current_picture.motion_val[0][mot_index + 2][0];
                        mv_predictor[pred_count][1]= s->current_picture.motion_val[0][mot_index + 2][1];
                        pred_count++;
                    }
                    if(mb_y>0 && fixed[mb_xy-mb_stride]){
                        mv_predictor[pred_count][0]= s->current_picture.motion_val[0][mot_index - mot_stride*2][0];
                        mv_predictor[pred_count][1]= s->current_picture.motion_val[0][mot_index - mot_stride*2][1];
                        pred_count++;
                    }
                    if(mb_y+1<mb_height && fixed[mb_xy+mb_stride]){
                        mv_predictor[pred_count][0]= s->current_picture.motion_val[0][mot_index + mot_stride*2][0];
                        mv_predictor[pred_count][1]= s->current_picture.motion_val[0][mot_index + mot_stride*2][1];
                        pred_count++;
                    }
                    if(pred_count==0) continue;
                    if(pred_count>1){
                        int sum_x=0, sum_y=0;
                        int max_x, max_y, min_x, min_y;
                        for(j=0; j<pred_count; j++){
                            sum_x+= mv_predictor[j][0];
                            sum_y+= mv_predictor[j][1];
                        }
                        mv_predictor[pred_count][0] = sum_x/j;
                        mv_predictor[pred_count][1] = sum_y/j;
                        if(pred_count>=3){
                            min_y= min_x= 99999;
                            max_y= max_x=-99999;
                        }else{
                            min_x=min_y=max_x=max_y=0;
                        }
                        for(j=0; j<pred_count; j++){
                            max_x= FFMAX(max_x, mv_predictor[j][0]);
                            max_y= FFMAX(max_y, mv_predictor[j][1]);
                            min_x= FFMIN(min_x, mv_predictor[j][0]);
                            min_y= FFMIN(min_y, mv_predictor[j][1]);
                        }
                        mv_predictor[pred_count+1][0] = sum_x - max_x - min_x;
                        mv_predictor[pred_count+1][1] = sum_y - max_y - min_y;
                        if(pred_count==4){
                            mv_predictor[pred_count+1][0] /= 2;
                            mv_predictor[pred_count+1][1] /= 2;
                        }
                        pred_count+=2;
                    }
                    pred_count++;
                    mv_predictor[pred_count][0]= s->current_picture.motion_val[0][mot_index][0];
                    mv_predictor[pred_count][1]= s->current_picture.motion_val[0][mot_index][1];
                    pred_count++;
                    s->mv_dir = MV_DIR_FORWARD;
                    s->mb_intra=0;
                    s->mv_type = MV_TYPE_16X16;
                    s->mb_skipped=0;
                    s->dsp.clear_blocks(s->block[0]);
                    s->mb_x= mb_x;
                    s->mb_y= mb_y;
                    for(j=0; j<pred_count; j++){
                        int score=0;
                        uint8_t *src= s->current_picture.data[0] + mb_x*16 + mb_y*16*s->linesize;
                        s->current_picture.motion_val[0][mot_index][0]= s->mv[0][0][0]= mv_predictor[j][0];
                        s->current_picture.motion_val[0][mot_index][1]= s->mv[0][0][1]= mv_predictor[j][1];
                        decode_mb(s);
                        if(mb_x>0 && fixed[mb_xy-1]){
                            int k;
                            for(k=0; k<16; k++)
                                score += FFABS(src[k*s->linesize-1 ]-src[k*s->linesize   ]);
                        }
                        if(mb_x+1<mb_width && fixed[mb_xy+1]){
                            int k;
                            for(k=0; k<16; k++)
                                score += FFABS(src[k*s->linesize+15]-src[k*s->linesize+16]);
                        }
                        if(mb_y>0 && fixed[mb_xy-mb_stride]){
                            int k;
                            for(k=0; k<16; k++)
                                score += FFABS(src[k-s->linesize   ]-src[k               ]);
                        }
                        if(mb_y+1<mb_height && fixed[mb_xy+mb_stride]){
                            int k;
                            for(k=0; k<16; k++)
                                score += FFABS(src[k+s->linesize*15]-src[k+s->linesize*16]);
                        }
                        if(score <= best_score){
                            best_score= score;
                            best_pred= j;
                        }
                    }
score_sum+= best_score;
                    s->current_picture.motion_val[0][mot_index][0]= s->mv[0][0][0]= mv_predictor[best_pred][0];
                    s->current_picture.motion_val[0][mot_index][1]= s->mv[0][0][1]= mv_predictor[best_pred][1];
                    decode_mb(s);
                    if(s->mv[0][0][0] != prev_x || s->mv[0][0][1] != prev_y){
                        fixed[mb_xy]=MV_CHANGED;
                        changed++;
                    }else
                        fixed[mb_xy]=MV_UNCHANGED;
                }
            }
        }
        if(none_left)
            return;
        for(i=0; i<s->mb_num; i++){
            int mb_xy= s->mb_index2xy[i];
            if(fixed[mb_xy])
                fixed[mb_xy]=MV_FROZEN;
        }
    }
}
['static void guess_mv(MpegEncContext *s){\n    uint8_t fixed[s->mb_stride * s->mb_height];\n#define MV_FROZEN    3\n#define MV_CHANGED   2\n#define MV_UNCHANGED 1\n    const int mb_stride = s->mb_stride;\n    const int mb_width = s->mb_width;\n    const int mb_height= s->mb_height;\n    int i, depth, num_avail;\n    int mb_x, mb_y;\n    num_avail=0;\n    for(i=0; i<s->mb_num; i++){\n        const int mb_xy= s->mb_index2xy[ i ];\n        int f=0;\n        int error= s->error_status_table[mb_xy];\n        if(IS_INTRA(s->current_picture.mb_type[mb_xy])) f=MV_FROZEN;\n        if(!(error&MV_ERROR)) f=MV_FROZEN;\n        fixed[mb_xy]= f;\n        if(f==MV_FROZEN)\n            num_avail++;\n    }\n    if((!(s->avctx->error_concealment&FF_EC_GUESS_MVS)) || num_avail <= mb_width/2){\n        for(mb_y=0; mb_y<s->mb_height; mb_y++){\n            for(mb_x=0; mb_x<s->mb_width; mb_x++){\n                const int mb_xy= mb_x + mb_y*s->mb_stride;\n                if(IS_INTRA(s->current_picture.mb_type[mb_xy]))  continue;\n                if(!(s->error_status_table[mb_xy]&MV_ERROR)) continue;\n                s->mv_dir = MV_DIR_FORWARD;\n                s->mb_intra=0;\n                s->mv_type = MV_TYPE_16X16;\n                s->mb_skipped=0;\n                s->dsp.clear_blocks(s->block[0]);\n                s->mb_x= mb_x;\n                s->mb_y= mb_y;\n                s->mv[0][0][0]= 0;\n                s->mv[0][0][1]= 0;\n                decode_mb(s);\n            }\n        }\n        return;\n    }\n    for(depth=0;; depth++){\n        int changed, pass, none_left;\n        none_left=1;\n        changed=1;\n        for(pass=0; (changed || pass<2) && pass<10; pass++){\n            int mb_x, mb_y;\nint score_sum=0;\n            changed=0;\n            for(mb_y=0; mb_y<s->mb_height; mb_y++){\n                for(mb_x=0; mb_x<s->mb_width; mb_x++){\n                    const int mb_xy= mb_x + mb_y*s->mb_stride;\n                    int mv_predictor[8][2]={{0}};\n                    int pred_count=0;\n                    int j;\n                    int best_score=256*256*256*64;\n                    int best_pred=0;\n                    const int mot_stride= s->b8_stride;\n                    const int mot_index= mb_x*2 + mb_y*2*mot_stride;\n                    int prev_x= s->current_picture.motion_val[0][mot_index][0];\n                    int prev_y= s->current_picture.motion_val[0][mot_index][1];\n                    if((mb_x^mb_y^pass)&1) continue;\n                    if(fixed[mb_xy]==MV_FROZEN) continue;\n                    assert(!IS_INTRA(s->current_picture.mb_type[mb_xy]));\n                    assert(s->last_picture_ptr && s->last_picture_ptr->data[0]);\n                    j=0;\n                    if(mb_x>0           && fixed[mb_xy-1        ]==MV_FROZEN) j=1;\n                    if(mb_x+1<mb_width  && fixed[mb_xy+1        ]==MV_FROZEN) j=1;\n                    if(mb_y>0           && fixed[mb_xy-mb_stride]==MV_FROZEN) j=1;\n                    if(mb_y+1<mb_height && fixed[mb_xy+mb_stride]==MV_FROZEN) j=1;\n                    if(j==0) continue;\n                    j=0;\n                    if(mb_x>0           && fixed[mb_xy-1        ]==MV_CHANGED) j=1;\n                    if(mb_x+1<mb_width  && fixed[mb_xy+1        ]==MV_CHANGED) j=1;\n                    if(mb_y>0           && fixed[mb_xy-mb_stride]==MV_CHANGED) j=1;\n                    if(mb_y+1<mb_height && fixed[mb_xy+mb_stride]==MV_CHANGED) j=1;\n                    if(j==0 && pass>1) continue;\n                    none_left=0;\n                    if(mb_x>0 && fixed[mb_xy-1]){\n                        mv_predictor[pred_count][0]= s->current_picture.motion_val[0][mot_index - 2][0];\n                        mv_predictor[pred_count][1]= s->current_picture.motion_val[0][mot_index - 2][1];\n                        pred_count++;\n                    }\n                    if(mb_x+1<mb_width && fixed[mb_xy+1]){\n                        mv_predictor[pred_count][0]= s->current_picture.motion_val[0][mot_index + 2][0];\n                        mv_predictor[pred_count][1]= s->current_picture.motion_val[0][mot_index + 2][1];\n                        pred_count++;\n                    }\n                    if(mb_y>0 && fixed[mb_xy-mb_stride]){\n                        mv_predictor[pred_count][0]= s->current_picture.motion_val[0][mot_index - mot_stride*2][0];\n                        mv_predictor[pred_count][1]= s->current_picture.motion_val[0][mot_index - mot_stride*2][1];\n                        pred_count++;\n                    }\n                    if(mb_y+1<mb_height && fixed[mb_xy+mb_stride]){\n                        mv_predictor[pred_count][0]= s->current_picture.motion_val[0][mot_index + mot_stride*2][0];\n                        mv_predictor[pred_count][1]= s->current_picture.motion_val[0][mot_index + mot_stride*2][1];\n                        pred_count++;\n                    }\n                    if(pred_count==0) continue;\n                    if(pred_count>1){\n                        int sum_x=0, sum_y=0;\n                        int max_x, max_y, min_x, min_y;\n                        for(j=0; j<pred_count; j++){\n                            sum_x+= mv_predictor[j][0];\n                            sum_y+= mv_predictor[j][1];\n                        }\n                        mv_predictor[pred_count][0] = sum_x/j;\n                        mv_predictor[pred_count][1] = sum_y/j;\n                        if(pred_count>=3){\n                            min_y= min_x= 99999;\n                            max_y= max_x=-99999;\n                        }else{\n                            min_x=min_y=max_x=max_y=0;\n                        }\n                        for(j=0; j<pred_count; j++){\n                            max_x= FFMAX(max_x, mv_predictor[j][0]);\n                            max_y= FFMAX(max_y, mv_predictor[j][1]);\n                            min_x= FFMIN(min_x, mv_predictor[j][0]);\n                            min_y= FFMIN(min_y, mv_predictor[j][1]);\n                        }\n                        mv_predictor[pred_count+1][0] = sum_x - max_x - min_x;\n                        mv_predictor[pred_count+1][1] = sum_y - max_y - min_y;\n                        if(pred_count==4){\n                            mv_predictor[pred_count+1][0] /= 2;\n                            mv_predictor[pred_count+1][1] /= 2;\n                        }\n                        pred_count+=2;\n                    }\n                    pred_count++;\n                    mv_predictor[pred_count][0]= s->current_picture.motion_val[0][mot_index][0];\n                    mv_predictor[pred_count][1]= s->current_picture.motion_val[0][mot_index][1];\n                    pred_count++;\n                    s->mv_dir = MV_DIR_FORWARD;\n                    s->mb_intra=0;\n                    s->mv_type = MV_TYPE_16X16;\n                    s->mb_skipped=0;\n                    s->dsp.clear_blocks(s->block[0]);\n                    s->mb_x= mb_x;\n                    s->mb_y= mb_y;\n                    for(j=0; j<pred_count; j++){\n                        int score=0;\n                        uint8_t *src= s->current_picture.data[0] + mb_x*16 + mb_y*16*s->linesize;\n                        s->current_picture.motion_val[0][mot_index][0]= s->mv[0][0][0]= mv_predictor[j][0];\n                        s->current_picture.motion_val[0][mot_index][1]= s->mv[0][0][1]= mv_predictor[j][1];\n                        decode_mb(s);\n                        if(mb_x>0 && fixed[mb_xy-1]){\n                            int k;\n                            for(k=0; k<16; k++)\n                                score += FFABS(src[k*s->linesize-1 ]-src[k*s->linesize   ]);\n                        }\n                        if(mb_x+1<mb_width && fixed[mb_xy+1]){\n                            int k;\n                            for(k=0; k<16; k++)\n                                score += FFABS(src[k*s->linesize+15]-src[k*s->linesize+16]);\n                        }\n                        if(mb_y>0 && fixed[mb_xy-mb_stride]){\n                            int k;\n                            for(k=0; k<16; k++)\n                                score += FFABS(src[k-s->linesize   ]-src[k               ]);\n                        }\n                        if(mb_y+1<mb_height && fixed[mb_xy+mb_stride]){\n                            int k;\n                            for(k=0; k<16; k++)\n                                score += FFABS(src[k+s->linesize*15]-src[k+s->linesize*16]);\n                        }\n                        if(score <= best_score){\n                            best_score= score;\n                            best_pred= j;\n                        }\n                    }\nscore_sum+= best_score;\n                    s->current_picture.motion_val[0][mot_index][0]= s->mv[0][0][0]= mv_predictor[best_pred][0];\n                    s->current_picture.motion_val[0][mot_index][1]= s->mv[0][0][1]= mv_predictor[best_pred][1];\n                    decode_mb(s);\n                    if(s->mv[0][0][0] != prev_x || s->mv[0][0][1] != prev_y){\n                        fixed[mb_xy]=MV_CHANGED;\n                        changed++;\n                    }else\n                        fixed[mb_xy]=MV_UNCHANGED;\n                }\n            }\n        }\n        if(none_left)\n            return;\n        for(i=0; i<s->mb_num; i++){\n            int mb_xy= s->mb_index2xy[i];\n            if(fixed[mb_xy])\n                fixed[mb_xy]=MV_FROZEN;\n        }\n    }\n}']